Documentation
¶
Index ¶
- type FullRequest
- type Gen
- type Generator
- func (g *Generator) AddTools(tool ...tools.Tool) *Generator
- func (b *Generator) MaxTokens(maxTokens int) *Generator
- func (b *Generator) Model(model Model) *Generator
- func (b *Generator) Prompt(prompts ...prompt.Prompt) (*Response, error)
- func (b *Generator) SetConfig(config Request) *Generator
- func (b *Generator) SetOutputSchema(element any) *Generator
- func (b *Generator) SetToolConfig(tool tools.Tool) *Generator
- func (b *Generator) SetTools(tool ...tools.Tool) *Generator
- func (b *Generator) StopAt(stop ...string) *Generator
- func (b *Generator) System(prompt string) *Generator
- func (b *Generator) Temperature(temperature float64) *Generator
- func (g *Generator) Tools() []tools.Tool
- func (b *Generator) TopP(topP float64) *Generator
- type Model
- type Option
- func WithMaxTokens(maxTokens int) Option
- func WithModel(model Model) Option
- func WithOutput(element any) Option
- func WithRequest(requset Request) Option
- func WithStopAt(stop ...string) Option
- func WithSystem(prompt string) Option
- func WithTemperature(temperature float64) Option
- func WithToolConfig(tool tools.Tool) Option
- func WithTools(tools ...tools.Tool) Option
- func WithTopP(topP float64) Option
- type Prompter
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FullRequest ¶
type Model ¶
type Model struct {
Provider string `json:"provider"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
InputContentTypes []string `json:"input_content_types,omitempty"`
InputMaxToken int `json:"input_max_token,omitempty"`
OutputMaxToken int `json:"output_max_token,omitempty"`
SupportTools bool `json:"support_tools,omitempty"`
SupportStructuredOutput bool `json:"support_structured_output,omitempty"`
}
type Option ¶
func WithMaxTokens ¶
func WithOutput ¶
func WithRequest ¶
func WithStopAt ¶
func WithSystem ¶
func WithTemperature ¶
func WithToolConfig ¶
type Request ¶
type Request struct {
Model Model `json:"model"`
SystemPrompt string `json:"system_prompt"`
StopSequences []string `json:"stop_sequences"`
TopP float64 `json:"top_p"`
Temperature float64 `json:"temperature"`
MaxTokens int `json:"max_tokens"`
OutputSchema *schema.JSON `json:"output_schema"`
Tools []tools.Tool `json:"tools"`
ToolConfig *tools.Tool `json:"tool"`
}
Click to show internal directories.
Click to hide internal directories.