Documentation
¶
Index ¶
- func CreateSubAgentTools(agentStorage map[string]Agent, createFuncs map[string]SubAgentConstructor) (Tool, Tool)
- type Action
- type ActionArg
- type ActionObservation
- type Agent
- type AgentModelBuilder
- type Observation
- type Scenario
- type SubAgentConstructor
- type Tool
- func AgentAsTool(buildAgent func() Agent, name string, description []string) Tool
- func FunctionalTool(do func(map[string]any) (string, error), name string, description []string) Tool
- func MapFuncTool[T any](mf jpf.MapFunc[T, string], name string, description []string) Tool
- func NewAgentQuickQuestionTool(buildAgent func() Agent, name string, agentDescription string) Tool
- func NewCustomExecuteCommandTool(name string, description []string, commandPath string, commandArgs ...string) Tool
- func NewExecuteCommandTool() Tool
- func NewListDirectoryTool() Tool
- func NewReadFileTool() Tool
- func NewScenarioRetrieverTool(scenarios map[string]Scenario) Tool
- func NewTimeTool() Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSubAgentTools ¶
Types ¶
type ActionObservation ¶
type ActionObservation struct {
Action Action `json:"action"`
Observation Observation `json:"observation"`
}
type AgentModelBuilder ¶
type AgentModelBuilder interface {
// Create a model with a structured output schema for the object provided.
BuildAgentModel(responseType any, onInitFinalStream func(), onDataFinalStream func(string)) jpf.Model
}
Specifies an object that can be called to create a model for the agent to use.
type Observation ¶
type Observation struct {
Observed string `json:"observed"`
}
type SubAgentConstructor ¶
type Tool ¶
type Tool interface {
// The name of the tool to be used by the agent.
Name() string
// Describe the tool in short bullet points to the agent.
Description() []string
// Call the tool, providing a formatted response or an error if the tool call failed.
Call(map[string]any) (string, error)
}
A function which can be described to and called by an agent.
func AgentAsTool ¶
func FunctionalTool ¶
func MapFuncTool ¶
func NewAgentQuickQuestionTool ¶
NewAgentQuickQuestionTool creates a tool that builds a fresh agent and asks a query. The tool's name will be agent_<name> and the description is formatted using agentDescription.
func NewCustomExecuteCommandTool ¶ added in v0.0.4
func NewExecuteCommandTool ¶ added in v0.0.4
func NewExecuteCommandTool() Tool
func NewListDirectoryTool ¶ added in v0.0.2
func NewListDirectoryTool() Tool
func NewReadFileTool ¶ added in v0.0.2
func NewReadFileTool() Tool
func NewTimeTool ¶ added in v0.0.2
func NewTimeTool() Tool
Click to show internal directories.
Click to hide internal directories.