Documentation
¶
Overview ¶
Package tools defines a standard interface for tools to be used by agents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
Calculator is a tool that can do math.
func (Calculator) Call ¶
Call evaluates the input using a starlak evaluator and returns the result as a string. If the evaluator errors the error is given in the result to give the agent the ability to retry.
func (Calculator) Description ¶
func (c Calculator) Description() string
Description returns a string describing the calculator tool.
type InjectedToolArg ¶ added in v1.5.3
type InjectedToolArg struct {
Value any
}
InjectedToolArg is a marker type for tool arguments that are injected at runtime rather than supplied by the model. It mirrors langchain_core.tools.InjectedToolArg. Declaring a parameter of this type in a tool's schema tells the model to ignore it, and the runtime fills it in.
type InjectedToolCallID ¶ added in v1.5.3
type InjectedToolCallID struct {
Value string
}
InjectedToolCallID is a marker type for the ID of the tool call being executed, injected at runtime. It mirrors langchain_core.tools.InjectedToolCallId.
type Tool ¶
type Tool interface {
Name() string
Description() string
Call(ctx context.Context, input string) (string, error)
}
Tool is a tool for the llm agent to interact with different applications.
func InjectArgs ¶ added in v1.5.3
InjectArgs wraps a tool so that the provided arguments are injected into its JSON input before execution.
type ToolCallContext ¶ added in v1.5.3
type ToolCallContext struct {
// CallID is the ID of the tool call that is being executed.
CallID string
// Args holds injected arguments keyed by name.
Args map[string]any
}
ToolCallContext carries the runtime-injected values available to a tool call.
func (ToolCallContext) GetInjectedArg ¶ added in v1.5.3
func (c ToolCallContext) GetInjectedArg(name string) (any, bool)
GetInjectedArg returns the injected argument for name, if present.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package duckduckgo contains an implementation of the tool interface with the duckduckgo api client.
|
Package duckduckgo contains an implementation of the tool interface with the duckduckgo api client. |
|
// Package metaphor contains an implementation of the tool interface with the metaphor search api client.
|
// Package metaphor contains an implementation of the tool interface with the metaphor search api client. |
|
Package perplexity provides integration with Perplexity AI's API for AI agents.
|
Package perplexity provides integration with Perplexity AI's API for AI agents. |
|
Package scraper contains an implementation of the tool interface for a web scraping tool.
|
Package scraper contains an implementation of the tool interface for a web scraping tool. |
|
Package serpapi contains an implementation of the tool interface with the serapi.
|
Package serpapi contains an implementation of the tool interface with the serapi. |
|
Package wikipedia contains an implementation of the tool interface with the wikipedia api.
|
Package wikipedia contains an implementation of the tool interface with the wikipedia api. |
|
Package zapier contains an implementation of the tool interface with the zapier NLA api client.
|
Package zapier contains an implementation of the tool interface with the zapier NLA api client. |