executor

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversationContext

type ConversationContext struct {
	Messages    []pkg.Message
	ToolResults map[string]*pkg.ToolResult
}

ConversationContext holds context for multi-turn conversations

func NewConversationContext

func NewConversationContext() *ConversationContext

NewConversationContext creates a new conversation context

func (*ConversationContext) AddMessage

func (c *ConversationContext) AddMessage(msg pkg.Message)

AddMessage adds a message to the conversation

func (*ConversationContext) AddToolResult

func (c *ConversationContext) AddToolResult(toolCallID string, result *pkg.ToolResult)

AddToolResult adds a tool result to the context

func (*ConversationContext) ToJSON

func (c *ConversationContext) ToJSON() (string, error)

ToJSON serializes the context to JSON

type ExecutorAgent

type ExecutorAgent struct {
	// contains filtered or unexported fields
}

ExecutorAgent executes tool calls from LLM responses

func New

func New(provider llm.Provider, model string) *ExecutorAgent

New creates a new executor agent

func (*ExecutorAgent) CanHandle

func (e *ExecutorAgent) CanHandle(task *pkg.Task) bool

CanHandle determines if this agent can handle the task

func (*ExecutorAgent) Execute

func (e *ExecutorAgent) Execute(ctx context.Context, task *pkg.Task) (*pkg.TaskResult, error)

Execute runs the executor agent

func (*ExecutorAgent) ExecuteToolCall

func (e *ExecutorAgent) ExecuteToolCall(ctx context.Context, toolCall pkg.ToolCall) (*pkg.ToolResult, error)

ExecuteToolCall executes a single tool call

func (*ExecutorAgent) GetAvailableTools

func (e *ExecutorAgent) GetAvailableTools() []string

GetAvailableTools returns the list of available tools

func (*ExecutorAgent) GetLLMTools

func (e *ExecutorAgent) GetLLMTools() []llm.Tool

GetLLMTools returns tools in LLM-compatible format

func (*ExecutorAgent) Name

func (e *ExecutorAgent) Name() string

Name returns the agent identifier

func (*ExecutorAgent) Priority

func (e *ExecutorAgent) Priority() int

Priority returns the agent's priority

func (*ExecutorAgent) RunInteractive

func (e *ExecutorAgent) RunInteractive(ctx context.Context, initialPrompt string, onToken func(string), onToolCall func(pkg.ToolCall, *pkg.ToolResult)) (string, error)

RunInteractive runs the executor in interactive mode with continuous tool execution

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL