Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶ added in v0.10.0
type Agent struct {
// contains filtered or unexported fields
}
Agent is the agent with real-time tool call display.
func NewAgent ¶ added in v0.10.0
func NewAgent(ctx context.Context, config *AgentConfig) (*Agent, error)
NewAgent creates an agent with MCP tool integration and real-time tool call display
func (*Agent) GenerateWithLoop ¶ added in v0.10.0
func (a *Agent) GenerateWithLoop(ctx context.Context, messages []*schema.Message, onToolCall ToolCallHandler, onToolExecution ToolExecutionHandler, onToolResult ToolResultHandler, onResponse ResponseHandler, onToolCallContent ToolCallContentHandler) (*GenerateWithLoopResult, error)
GenerateWithLoop processes messages with a custom loop that displays tool calls in real-time
type AgentConfig ¶ added in v0.10.0
type AgentConfig struct {
ModelConfig *models.ProviderConfig
MCPConfig *config.Config
SystemPrompt string
MaxSteps int
}
AgentConfig is the config for agent.
type GenerateWithLoopResult ¶ added in v0.17.0
type GenerateWithLoopResult struct {
FinalResponse *schema.Message
ConversationMessages []*schema.Message // All messages in the conversation (including tool calls and results)
}
GenerateWithLoopResult contains the result and conversation history
type ResponseHandler ¶ added in v0.10.0
type ResponseHandler func(content string)
ResponseHandler is a function type for handling LLM responses
type ToolCallContentHandler ¶ added in v0.10.0
type ToolCallContentHandler func(content string)
ToolCallContentHandler is a function type for handling content that accompanies tool calls
type ToolCallHandler ¶ added in v0.10.0
type ToolCallHandler func(toolName, toolArgs string)
ToolCallHandler is a function type for handling tool calls as they happen
type ToolExecutionHandler ¶ added in v0.11.0
ToolExecutionHandler is a function type for handling tool execution start/end
type ToolResultHandler ¶ added in v0.10.0
ToolResultHandler is a function type for handling tool results