Documentation
¶
Index ¶
- type Agent
- func (a *Agent) A2ACard() *a2a.AgentCard
- func (a *Agent) A2AClient() *a2a.A2AClient
- func (a *Agent) A2AServer() *a2a.A2AServer
- func (a *Agent) Close(ctx context.Context)
- func (a *Agent) DelegateTo(ctx context.Context, role, request string) (*a2a.DelegationFuture, error)
- func (a *Agent) Equip(t ...tools.Tool)
- func (a *Agent) Execute(ctx context.Context, taskDesc, expectedOutput string, ctxTasks []string) (string, error)
- func (a *Agent) GetBackstory() string
- func (a *Agent) GetGoal() string
- func (a *Agent) GetMaxIter() int
- func (a *Agent) GetRole() string
- func (a *Agent) GetTools() []tools.Tool
- func (a *Agent) GetUsageMetrics() map[string]int
- func (a *Agent) HandleA2AMessage(ctx context.Context, msg *a2a.A2AMessage) (*a2a.A2AMessage, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
Agent represents an AI agent with a role, goal, tools, and memory.
func (*Agent) A2ACard ¶ added in v0.2.0
A2ACard returns the agent's A2A agent card, or nil if not registered.
func (*Agent) A2AClient ¶ added in v0.2.0
A2AClient returns the agent's A2A client, or nil if not enabled.
func (*Agent) A2AServer ¶ added in v0.2.0
A2AServer returns the agent's A2A server, or nil if not enabled.
func (*Agent) Close ¶ added in v0.2.0
@sk-task a2a#polish: Close shuts down the A2A server and unregisters the agent card.
func (*Agent) DelegateTo ¶ added in v0.2.0
func (a *Agent) DelegateTo(ctx context.Context, role, request string) (*a2a.DelegationFuture, error)
DelegateTo delegates a task to another agent by role and returns a DelegationFuture.
func (*Agent) Execute ¶
func (a *Agent) Execute(ctx context.Context, taskDesc, expectedOutput string, ctxTasks []string) (string, error)
Execute runs the agent's ReAct loop to complete a given task and returns the output.
func (*Agent) GetBackstory ¶
GetBackstory returns the agent's backstory.
func (*Agent) GetMaxIter ¶
GetMaxIter returns the maximum number of iterations for the agent's ReAct loop.
func (*Agent) GetUsageMetrics ¶
GetUsageMetrics returns the agent's token and tool usage metrics.
func (*Agent) HandleA2AMessage ¶ added in v0.2.0
func (a *Agent) HandleA2AMessage(ctx context.Context, msg *a2a.A2AMessage) (*a2a.A2AMessage, error)
@sk-task a2a#polish: HandleA2AMessage processes an incoming delegation and returns a typed response.
type Config ¶
type Config struct {
Role string
Goal string
Backstory string
LLM llm.Client
Tools []tools.Tool
Memory memory.Store
MaxIter int
MaxRPM int
MaxRetries int
MaxExecutionTime time.Duration
Verbose bool
AllowDelegation bool
StepCallback callback.Callback
// @sk-task a2a#T3.2: A2A protocol fields (AC-006)
A2APort int
A2AAuthToken string
A2ACapabilities []string
}
Config defines the configuration for an Agent.