tools

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedDebugLogger added in v0.28.0

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

BufferedDebugLogger stores debug messages until they can be displayed

func NewBufferedDebugLogger added in v0.28.0

func NewBufferedDebugLogger(enabled bool) *BufferedDebugLogger

NewBufferedDebugLogger creates a new buffered debug logger

func (*BufferedDebugLogger) GetMessages added in v0.28.0

func (l *BufferedDebugLogger) GetMessages() []string

GetMessages returns all buffered messages and clears the buffer

func (*BufferedDebugLogger) IsDebugEnabled added in v0.28.0

func (l *BufferedDebugLogger) IsDebugEnabled() bool

IsDebugEnabled returns whether debug logging is enabled

func (*BufferedDebugLogger) LogDebug added in v0.28.0

func (l *BufferedDebugLogger) LogDebug(message string)

LogDebug stores a debug message

type ConnectionPoolConfig added in v0.27.0

type ConnectionPoolConfig struct {
	MaxIdleTime         time.Duration
	MaxRetries          int
	HealthCheckInterval time.Duration
	MaxErrorCount       int
	ReconnectDelay      time.Duration
}

ConnectionPoolConfig configuration for connection pool

func DefaultConnectionPoolConfig added in v0.27.0

func DefaultConnectionPoolConfig() *ConnectionPoolConfig

DefaultConnectionPoolConfig returns default configuration

type DebugLogger added in v0.28.0

type DebugLogger interface {
	LogDebug(message string)
	IsDebugEnabled() bool
}

DebugLogger interface for debug logging

type MCPConnection added in v0.27.0

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

MCPConnection represents an MCP connection

func (*MCPConnection) ServerName added in v0.27.0

func (c *MCPConnection) ServerName() string

ServerName returns the server name for this connection

type MCPConnectionPool added in v0.27.0

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

MCPConnectionPool manages MCP connections

func NewMCPConnectionPool added in v0.27.0

func NewMCPConnectionPool(config *ConnectionPoolConfig, model model.ToolCallingChatModel, debug bool) *MCPConnectionPool

NewMCPConnectionPool creates a new connection pool

func (*MCPConnectionPool) Close added in v0.27.0

func (p *MCPConnectionPool) Close() error

Close closes the connection pool

func (*MCPConnectionPool) GetClients added in v0.27.0

func (p *MCPConnectionPool) GetClients() map[string]client.MCPClient

GetClients returns all client names in the pool

func (*MCPConnectionPool) GetConnection added in v0.27.0

func (p *MCPConnectionPool) GetConnection(ctx context.Context, serverName string, serverConfig config.MCPServerConfig) (*MCPConnection, error)

GetConnection gets a connection from the pool

func (*MCPConnectionPool) GetConnectionStats added in v0.27.0

func (p *MCPConnectionPool) GetConnectionStats() map[string]interface{}

GetConnectionStats returns connection statistics

func (*MCPConnectionPool) GetConnectionWithHealthCheck added in v0.27.0

func (p *MCPConnectionPool) GetConnectionWithHealthCheck(ctx context.Context, serverName string, serverConfig config.MCPServerConfig) (*MCPConnection, error)

GetConnectionWithHealthCheck gets a connection from the pool with proactive health check

func (*MCPConnectionPool) HandleConnectionError added in v0.27.0

func (p *MCPConnectionPool) HandleConnectionError(serverName string, err error)

HandleConnectionError handles connection errors

func (*MCPConnectionPool) SetDebugLogger added in v0.28.0

func (p *MCPConnectionPool) SetDebugLogger(logger DebugLogger)

SetDebugLogger sets the debug logger for the connection pool

type MCPToolManager

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

MCPToolManager manages MCP tools and clients

func NewMCPToolManager

func NewMCPToolManager() *MCPToolManager

NewMCPToolManager creates a new MCP tool manager

func (*MCPToolManager) Close

func (m *MCPToolManager) Close() error

Close closes all MCP clients

func (*MCPToolManager) GetLoadedServerNames added in v0.19.0

func (m *MCPToolManager) GetLoadedServerNames() []string

GetLoadedServerNames returns the names of successfully loaded MCP servers

func (*MCPToolManager) GetTools

func (m *MCPToolManager) GetTools() []tool.BaseTool

GetTools returns all loaded tools

func (*MCPToolManager) LoadTools

func (m *MCPToolManager) LoadTools(ctx context.Context, config *config.Config) error

LoadTools loads tools from MCP servers based on configuration

func (*MCPToolManager) SetDebugLogger added in v0.28.0

func (m *MCPToolManager) SetDebugLogger(logger DebugLogger)

SetDebugLogger sets the debug logger

func (*MCPToolManager) SetModel added in v0.23.0

func (m *MCPToolManager) SetModel(model model.ToolCallingChatModel)

SetModel sets the LLM model for sampling support

type SimpleDebugLogger added in v0.28.0

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

SimpleDebugLogger is a simple implementation that prints to stdout

func NewSimpleDebugLogger added in v0.28.0

func NewSimpleDebugLogger(enabled bool) *SimpleDebugLogger

NewSimpleDebugLogger creates a new simple debug logger

func (*SimpleDebugLogger) IsDebugEnabled added in v0.28.0

func (l *SimpleDebugLogger) IsDebugEnabled() bool

IsDebugEnabled returns whether debug logging is enabled

func (*SimpleDebugLogger) LogDebug added in v0.28.0

func (l *SimpleDebugLogger) LogDebug(message string)

LogDebug logs a debug message

Jump to

Keyboard shortcuts

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