Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StaticFunctionMap = make(map[string]ToolFunc)
Functions ¶
func IsImplementationAvailable ¶
IsImplementationAvailable checks if a function implementation exists
func RegisterFunction ¶
RegisterFunction allows runtime registration of functions (optional feature)
Types ¶
type FunctionDefinition ¶
type FunctionDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters any `json:"parameters"`
}
FunctionDefinition defines a function that can be called by the LLM
type Info ¶ added in v0.5.0
type Info struct {
ImplKey string `json:"impl_key"`
Description string `json:"description"`
Parameters models.JSONMap `json:"parameters"`
// Scoped: the function accepts a "collections" scope.
Scoped bool `json:"scoped"`
}
Info describes a built-in function for people configuring agents: what it does and the JSON schema of its arguments, ready to use as a function's "parameters".
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps a tool's name to its executable function.
func NewRegistry ¶
func NewRegistry(agentFuncs agentModels.FunctionSpecs) *Registry
NewRegistry creates a new tool registry from a list of agent function specs.
func (*Registry) ImplKey ¶ added in v0.5.0
ImplKey returns the implementation key of a registered tool.
func (*Registry) ListFunctions ¶
ListFunctions returns a list of registered function names (for debugging)
func (*Registry) ToLangchainTools ¶
ToLangchainTools converts the registry to langchain-compatible []llms.Tool
type RegistryTool ¶
type RegistryTool struct {
// contains filtered or unexported fields
}
RegistryTool implements langchain's tools.Tool interface
func (*RegistryTool) Description ¶
func (t *RegistryTool) Description() string
Description returns the tool description (implements tools.Tool interface)
func (*RegistryTool) Name ¶
func (t *RegistryTool) Name() string
Name returns the tool name (implements tools.Tool interface)
type ToolSpec ¶
type ToolSpec struct {
Type string `json:"type"`
Function *FunctionDefinition `json:"function"`
}
ToolSpec represents a function specification for the LLM
type WriteMode ¶ added in v0.6.0
type WriteMode int
WriteMode is how content functions handle writes in a run.
const ( // WriteLive applies writes. WriteLive WriteMode = iota // WriteDryRun validates writes and reports what they would do, without // writing anything (test runs). WriteDryRun // WritePropose validates writes and stores them as proposals an editor // approves (agents with require_approval). WritePropose )