Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶
type ChatRequest struct { Input string `json:"input"` MaxNewTokens int `json:"max_new_tokens"` DoSample bool `json:"do_sample"` Temp float64 `json:"temperature"` TopP float64 `json:"top_p"` TypicalP float64 `json:"typical_p"` RepetitionPenalty float64 `json:"repetition_penalty"` TopK float64 `json:"top_k"` MinLength int `json:"min_length"` NoRepeatNgramSize int `json:"no_repeat_ngram_size"` NumBeams int `json:"num_beams"` PenaltyAlpha float64 `json:"penalty_alpha"` LengthPenalty float64 `json:"length_penalty"` EarlyStopping bool `json:"early_stopping"` YourName string `json:"your_name"` BotName string `json:"bot_name"` Context string `json:"context"` StopAfterNewline bool `json:"stop_after_newline"` MaxPromptSize int `json:"max_prompt_size"` GenerationAttempts int `json:"generation_attempts"` }
func (*ChatRequest) ApplyCharacter ¶
func (cr *ChatRequest) ApplyCharacter(name string) error
func (*ChatRequest) ApplyPreset ¶
func (cr *ChatRequest) ApplyPreset(name string) error
ApplyPreset mutates cr with the details in the preset by name.
func (*ChatRequest) MarshalJSON ¶
func (cr *ChatRequest) MarshalJSON() ([]byte, error)
type ChatResponse ¶
type ChatResponse struct { Data []string `json:"data"` // [0] is user input, [1] is bot output Duration float64 `json:"duration"` IsGenerating bool `json:"is_generating"` }
func Generate ¶
func Generate(ctx context.Context, inp *ChatRequest) (*ChatResponse, error)
Click to show internal directories.
Click to hide internal directories.