Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Describe ¶
Describe gets a tool description, or an empty string if the tool doesn't provide additional description.
func DescribeCall ¶ added in v0.0.4
Types ¶
type DescriptionSource ¶
type Function ¶
type Function struct {
// The name of the function to be called. Must be a-z, A-Z, 0-9, or
// contain underscores and dashes, with a maximum length of 64.
Name string `json:"name" validate:"required"`
// A description of what the function does, used by the model to
// choose when and how to call the function.
Description string `json:"description,omitempty"`
// The parameters the functions accepts, described as a JSON Schema object.
Parameters map[string]any `json:"parameters" validate:"required"`
}
func MustUnmarshalFn ¶
MustUnmarshalFn unmarshals a JSON-encoded tool function and panics on error.
func UnmarshalFn ¶
UnmarshalFn unmarshals a JSON-encoded tool function and returns a ToolFunction struct.
type Tool ¶
type Tool struct {
// The type of the tool. Currently, only `function` is supported.
Type string `json:"type" validate:"required,oneof=function"`
// Description of the function.
Function *Function `json:"function,omitempty"`
}
func MustUnmarshalTool ¶
MustUnmarshalTool unmarshals a JSON-encoded tool and panics on error.
func UnmarshalTool ¶
UnmarshalTool unmarshals a JSON-encoded tool and returns a Tool struct.
Click to show internal directories.
Click to hide internal directories.