agent

package
v0.0.0-...-9bbf5fc Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	// SendMessage sends a message to the agent and returns the response
	SendMessage(ctx context.Context, args ...string) (string, error)

	// SendMessageWithRetry sends a message to the agent but prompts the user to retry
	// when the agent replies with an invalid response format (Not ReAct)
	SendMessageWithRetry(ctx context.Context, args ...string) (string, error)

	// Stop terminates the agent and performs any necessary cleanup
	Stop() error
}

Agent represents an AI agent that can execute tools and interact with language models.

func NewConversationalAzdAiAgent

func NewConversationalAzdAiAgent(llm llms.Model, console input.Console, opts ...AgentCreateOption) (Agent, error)

NewConversationalAzdAiAgent creates a new conversational agent with memory, tool loading, and MCP sampling capabilities. It filters out excluded tools and configures the agent for interactive conversations with a high iteration limit for complex tasks.

type AgentCleanup

type AgentCleanup func() error

AgentCleanup is a function that performs cleanup tasks for an agent.

type AgentCreateOption

type AgentCreateOption func(*agentBase)

AgentCreateOption is a functional option for configuring an Agent

func WithCallbacksHandler

func WithCallbacksHandler(handler callbacks.Handler) AgentCreateOption

WithCallbacksHandler returns an option that sets the callbacks handler for the agent

func WithCleanup

func WithCleanup(cleanupFunc AgentCleanup) AgentCreateOption

WithCleanup returns an option that sets the cleanup function for the agent

func WithDebug

func WithDebug(debug bool) AgentCreateOption

WithDebug returns an option that enables or disables debug logging for the agent

func WithDefaultModel

func WithDefaultModel(model llms.Model) AgentCreateOption

WithDefaultModel returns an option that sets the default language model for the agent

func WithFileWatching

func WithFileWatching(enabled bool) AgentCreateOption

WithFileWatching returns an option that enables or disables file watching for the agent

func WithMaxIterations

func WithMaxIterations(maxIterations int) AgentCreateOption

WithMaxIterations returns an option that sets the maximum number of iterations for the agent

func WithThoughtChannel

func WithThoughtChannel(thoughtChan chan logging.Thought) AgentCreateOption

WithThoughtChannel returns an option that sets the thought channel for the agent

func WithTools

func WithTools(tools ...common.AnnotatedTool) AgentCreateOption

WithTools returns an option that adds the specified tools to the agent's toolkit

type AgentFactory

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

AgentFactory is responsible for creating agent instances

func NewAgentFactory

func NewAgentFactory(
	consentManager consent.ConsentManager,
	console input.Console,
	llmManager *llm.Manager,
	securityManager *security.Manager,
) *AgentFactory

NewAgentFactory creates a new instance of AgentFactory

func (*AgentFactory) Create

func (f *AgentFactory) Create(ctx context.Context, opts ...AgentCreateOption) (Agent, error)

CreateAgent creates a new agent instance

type ConversationalAzdAiAgent

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

ConversationalAzdAiAgent represents an enhanced `azd` agent with conversation memory, tool filtering, and interactive capabilities

func (*ConversationalAzdAiAgent) SendMessage

func (aai *ConversationalAzdAiAgent) SendMessage(ctx context.Context, args ...string) (string, error)

SendMessage processes a single message through the agent and returns the response

func (*ConversationalAzdAiAgent) SendMessageWithRetry

func (aai *ConversationalAzdAiAgent) SendMessageWithRetry(ctx context.Context, args ...string) (string, error)

func (ConversationalAzdAiAgent) Stop

func (a ConversationalAzdAiAgent) Stop() error

Stop terminates the agent and performs any necessary cleanup

Directories

Path Synopsis
dev
io
mcp

Jump to

Keyboard shortcuts

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