Documentation
¶
Index ¶
- type ConnectionPoolConfig
- type MCPConnection
- type MCPConnectionPool
- func (p *MCPConnectionPool) Close() error
- func (p *MCPConnectionPool) GetClients() map[string]client.MCPClient
- func (p *MCPConnectionPool) GetConnection(ctx context.Context, serverName string, serverConfig config.MCPServerConfig) (*MCPConnection, error)
- func (p *MCPConnectionPool) GetConnectionStats() map[string]interface{}
- func (p *MCPConnectionPool) GetConnectionWithHealthCheck(ctx context.Context, serverName string, serverConfig config.MCPServerConfig) (*MCPConnection, error)
- func (p *MCPConnectionPool) HandleConnectionError(serverName string, err error)
- type MCPToolManager
- func (m *MCPToolManager) Close() error
- func (m *MCPToolManager) GetLoadedServerNames() []string
- func (m *MCPToolManager) GetTools() []tool.BaseTool
- func (m *MCPToolManager) LoadTools(ctx context.Context, config *config.Config) error
- func (m *MCPToolManager) SetModel(model model.ToolCallingChatModel)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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) *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
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) 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) SetModel ¶ added in v0.23.0
func (m *MCPToolManager) SetModel(model model.ToolCallingChatModel)
SetModel sets the LLM model for sampling support