Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatResult ¶
FormatResult formats a tool execution result as JSON string
func ParseArguments ¶
ParseArguments parses JSON arguments string into a map
func ToModelToolDefinitions ¶
func ToModelToolDefinitions(toolkits []Toolkit) []models.ToolDefinition
ToModelToolDefinitions converts toolkit functions to model tool definitions
Types ¶
type BaseToolkit ¶
type BaseToolkit struct {
// contains filtered or unexported fields
}
BaseToolkit provides common functionality for toolkit implementations
func NewBaseToolkit ¶
func NewBaseToolkit(name string) *BaseToolkit
NewBaseToolkit creates a new base toolkit
func (*BaseToolkit) Execute ¶
func (t *BaseToolkit) Execute(ctx context.Context, fnName string, args map[string]interface{}) (interface{}, error)
Execute calls a function by name with the given arguments
func (*BaseToolkit) Functions ¶
func (t *BaseToolkit) Functions() map[string]*Function
Functions returns all functions
func (*BaseToolkit) RegisterFunction ¶
func (t *BaseToolkit) RegisterFunction(fn *Function)
RegisterFunction registers a new function to the toolkit
type Function ¶
type Function struct {
Name string
Description string
Parameters map[string]Parameter
Handler HandlerFunc
}
Function represents a callable tool function
type HandlerFunc ¶
HandlerFunc is the function signature for tool handlers
type Parameter ¶
type Parameter struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Enum []string `json:"enum,omitempty"`
Default interface{} `json:"default,omitempty"`
Items *Parameter `json:"items,omitempty"` // For array types: defines the type of array elements
}
Parameter defines a function parameter
Click to show internal directories.
Click to hide internal directories.