agent

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ModelConfig   *models.ProviderConfig
	MCPConfig     *config.Config
	SystemPrompt  string
	MaxSteps      int
	MessageWindow int
}

Config holds configuration for creating an MCPAgent

type MCPAgent

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

MCPAgent wraps the eino React Agent with MCP tool integration

func NewMCPAgent

func NewMCPAgent(ctx context.Context, config *Config) (*MCPAgent, error)

NewMCPAgent creates a new agent with MCP tool integration

func (*MCPAgent) Close

func (a *MCPAgent) Close() error

Close closes the agent and cleans up resources

func (*MCPAgent) Generate

func (a *MCPAgent) Generate(ctx context.Context, messages []*schema.Message, opts ...compose.Option) (*schema.Message, error)

Generate processes a message and returns the agent's response

func (*MCPAgent) GetTools

func (a *MCPAgent) GetTools() []tool.BaseTool

GetTools returns the list of available tools

func (*MCPAgent) Stream

func (a *MCPAgent) Stream(ctx context.Context, messages []*schema.Message, opts ...compose.Option) (*schema.StreamReader[*schema.Message], error)

Stream processes a message and returns a streaming response

Jump to

Keyboard shortcuts

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