Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AutoTool = ToolChoice{Name: "auto"}
AutoTool means the model can pick between generating a message or calling one or more tools
View Source
var ControlTools = []ToolChoice{ NoTool, AutoTool, RequiredTool, }
View Source
var NoTool = ToolChoice{Name: "none"}
NoTool means the model will not call any tool and instead generates a message
View Source
var RequiredTool = ToolChoice{Name: "required"}
RequiredTool means the model must call one or more tools.
Functions ¶
This section is empty.
Types ¶
type Tool ¶
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
ArgumentSchema *schema.JSON `json:"argument_schema,omitempty"`
Function func(ctx context.Context, call Call) (string, error) `json:"-"`
}
func NewTool ¶
func NewTool(name string, options ...ToolOption) Tool
type ToolChoice ¶ added in v1.0.15
type ToolChoice struct {
Name string `json:"name"`
}
ToolChoice represents a tool selection configuration for the model. It is distinct from Tool — it only carries a name used to control tool behavior.
type ToolOption ¶
func WithArgSchema ¶ added in v0.1.0
func WithArgSchema(arg any) ToolOption
func WithDescription ¶
func WithDescription(description string) ToolOption
func WithFunction ¶ added in v0.2.0
func WithFunction(callback Function) ToolOption
Click to show internal directories.
Click to hide internal directories.