agent

package
v1.785.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIdFromServerNameAndToolName

func GetIdFromServerNameAndToolName(ServerName, toolName string) string

func GetMCPClientMap

func GetMCPClientMap(config string, toolsMap map[string]bool) (map[string]*client.Client, error)

func GetServerNameAndToolNameFromId

func GetServerNameAndToolNameFromId(id string) (string, string)

func ScanInto

func ScanInto(dst *[]*McpTools, src interface{}) error

ScanInto is a helper for receiving any value into a *[]*McpTools when the field can't easily be retyped to McpToolsList.

Types

type AgentClients

type AgentClients struct {
	Clients          map[string]*client.Client
	Tools            []*protocol.Tool
	BuiltinToolReg   *builtin_tool.ToolRegistry
	WebSearchEnabled bool
}

func MergeBuiltinAndWebSearchTools

func MergeBuiltinAndWebSearchTools(agentClients *AgentClients, selectedTools []string, webSearchEnabled bool) *AgentClients

type AgentProvider

type AgentProvider interface {
	GetAgentClients() (*AgentClients, error)
}

func GetAgentProvider

func GetAgentProvider(typ string, subType string, text string, mcpTools []*McpTools, lang string) (AgentProvider, error)

type McpAgentProvider

type McpAgentProvider struct {
	Typ        string
	SubType    string
	McpServers string
	McpTools   []*McpTools
}

func NewMcpAgentProvider

func NewMcpAgentProvider(typ string, subType string, mcpServers string, mcpTools []*McpTools) (*McpAgentProvider, error)

func (*McpAgentProvider) GetAgentClients

func (p *McpAgentProvider) GetAgentClients() (*AgentClients, error)

type McpTools

type McpTools struct {
	ServerName string `json:"serverName"`
	Tools      string `json:"tools"`
	IsEnabled  bool   `json:"isEnabled"`
}

func GetToolsList

func GetToolsList(config string) ([]*McpTools, error)

type McpToolsList

type McpToolsList []*McpTools

McpToolsList is a typed alias for []*McpTools that implements sql.Scanner + driver.Valuer. Use it in DB-mapped structs.

func (*McpToolsList) Scan

func (l *McpToolsList) Scan(src interface{}) error

Scan implements sql.Scanner for the slice. Accepts string, []byte, or nil.

func (McpToolsList) Value

func (l McpToolsList) Value() (driver.Value, error)

Value implements driver.Valuer. Returns JSON string (empty list as `[]`).

type ServerConfig

type ServerConfig struct {
	// Stdio config
	Command string            `json:"command"`
	Args    []string          `json:"args"`
	Env     map[string]string `json:"env"`

	// SSE config
	URL string `json:"url"`

	// Transport type: "sse", "stdio", "streamablehttp"
	// If not specified, auto-detected based on URL field:
	// - URL not empty -> SSE
	// - URL empty -> Stdio
	Type string `json:"type,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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