Documentation
¶
Index ¶
- func ConvertYAMLSchemaToResponseFormat(config *ResponseFormatConfig) (*interfaces.ResponseFormat, error)
- func CreateMemoryFromConfig(memoryConfig map[string]interface{}, llmClient interfaces.LLM) (interfaces.Memory, error)
- func ExpandEnv(s string) string
- func FormatSystemPromptFromConfig(config AgentConfig, variables map[string]string) string
- func GenerateConfigFromSystemPrompt(ctx context.Context, llm interfaces.LLM, systemPrompt string) (AgentConfig, []TaskConfig, error)
- func GetAgentForTask(taskConfigs TaskConfigs, taskName string) (string, error)
- func GetEnvValue(key string) string
- func GetInvocationID(ctx context.Context) string
- func GetParentAgent(ctx context.Context) string
- func GetRecursionDepth(ctx context.Context) int
- func GetSubAgentName(ctx context.Context) string
- func IsSubAgentCall(ctx context.Context) bool
- func LoadEnvFile(path string) error
- func SaveAgentConfigsToFile(configs AgentConfigs, file *os.File) error
- func SaveMCPConfigToJSON(config *MCPConfiguration, filePath string) error
- func SaveMCPConfigToYAML(config *MCPConfiguration, filePath string) error
- func SaveTaskConfigsToFile(configs TaskConfigs, file *os.File) error
- func ValidateMCPConfig(config *MCPConfiguration) error
- func ValidateRecursionDepth(ctx context.Context) error
- func WithSubAgentContext(ctx context.Context, parentAgent, subAgentName string) context.Context
- func WithTimeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- type Agent
- func CreateAgentForTask(taskName string, agentConfigs AgentConfigs, taskConfigs TaskConfigs, ...) (*Agent, error)
- func NewAgent(options ...Option) (*Agent, error)
- func NewAgentFromConfig(agentName string, configs AgentConfigs, variables map[string]string, ...) (*Agent, error)
- func NewAgentWithAutoConfig(ctx context.Context, options ...Option) (*Agent, error)
- func (a *Agent) ApproveExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan) (string, error)
- func (a *Agent) Disconnect() error
- func (a *Agent) ExecuteTaskFromConfig(ctx context.Context, taskName string, taskConfigs TaskConfigs, ...) (string, error)
- func (a *Agent) GenerateExecutionPlan(ctx context.Context, input string) (*executionplan.ExecutionPlan, error)
- func (a *Agent) GetAllConversations(ctx context.Context) ([]string, error)
- func (a *Agent) GetCapabilities() string
- func (a *Agent) GetConversationMessages(ctx context.Context, conversationID string) ([]interfaces.Message, error)
- func (a *Agent) GetDescription() string
- func (a *Agent) GetGeneratedAgentConfig() *AgentConfig
- func (a *Agent) GetGeneratedTaskConfigs() TaskConfigs
- func (a *Agent) GetLLM() interfaces.LLM
- func (a *Agent) GetLogger() logging.Logger
- func (a *Agent) GetMemory() interfaces.Memory
- func (a *Agent) GetMemoryConfig() map[string]interface{}
- func (a *Agent) GetMemoryStatistics(ctx context.Context) (totalConversations, totalMessages int, err error)
- func (a *Agent) GetName() string
- func (a *Agent) GetRemoteMetadata() (map[string]string, error)
- func (a *Agent) GetRemoteURL() string
- func (a *Agent) GetSubAgent(name string) (*Agent, bool)
- func (a *Agent) GetSubAgents() []*Agent
- func (a *Agent) GetSystemPrompt() string
- func (a *Agent) GetTaskByID(taskID string) (*executionplan.ExecutionPlan, bool)
- func (a *Agent) GetTools() []interfaces.Tool
- func (a *Agent) GetTracer() interfaces.Tracer
- func (a *Agent) HasSubAgent(name string) bool
- func (a *Agent) IsRemote() bool
- func (a *Agent) ListTasks() []*executionplan.ExecutionPlan
- func (a *Agent) ModifyExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan, modifications string) (*executionplan.ExecutionPlan, error)
- func (a *Agent) Run(ctx context.Context, input string) (string, error)
- func (a *Agent) RunDetailed(ctx context.Context, input string) (*interfaces.AgentResponse, error)
- func (a *Agent) RunStream(ctx context.Context, input string) (<-chan interfaces.AgentStreamEvent, error)
- func (a *Agent) RunStreamWithAuth(ctx context.Context, input string, authToken string) (<-chan interfaces.AgentStreamEvent, error)
- func (a *Agent) RunWithAuth(ctx context.Context, input string, authToken string) (string, error)
- func (a *Agent) RunWithAuthDetailed(ctx context.Context, input string, authToken string) (*interfaces.AgentResponse, error)
- type AgentConfig
- type AgentConfigs
- type AgentToolWrapper
- func (atw *AgentToolWrapper) Description() string
- func (atw *AgentToolWrapper) Execute(ctx context.Context, args string) (string, error)
- func (atw *AgentToolWrapper) Name() string
- func (atw *AgentToolWrapper) Parameters() map[string]interfaces.ParameterSpec
- func (atw *AgentToolWrapper) Run(ctx context.Context, input string) (string, error)
- type ContextKey
- type CustomRunFunction
- type CustomRunStreamFunction
- type LLMConfigYAML
- type LLMProviderYAML
- type LazyMCPConfig
- type LazyMCPToolConfig
- type MCPConfiguration
- type MCPDiscoveredCapabilities
- type MCPDiscoveredServerInfo
- type MCPGlobalConfig
- type MCPServerConfig
- type MemoryConfigYAML
- type Option
- func WithAgentConfig(config AgentConfig, variables map[string]string) Option
- func WithAgents(subAgents ...*Agent) Option
- func WithCustomRunFunction(fn CustomRunFunction) Option
- func WithCustomRunStreamFunction(fn CustomRunStreamFunction) Option
- func WithDescription(description string) Option
- func WithGuardrails(guardrails interfaces.Guardrails) Option
- func WithLLM(llm interfaces.LLM) Option
- func WithLLMConfig(config interfaces.LLMConfig) Option
- func WithLazyMCPConfigs(configs []LazyMCPConfig) Option
- func WithLogger(logger logging.Logger) Option
- func WithMCPConfig(config *MCPConfiguration) Option
- func WithMCPConfigFromJSON(filePath string) Option
- func WithMCPConfigFromYAML(filePath string) Option
- func WithMCPPresets(presetNames ...string) Option
- func WithMCPServers(mcpServers []interfaces.MCPServer) Option
- func WithMCPURLs(urls ...string) Option
- func WithMaxIterations(maxIterations int) Option
- func WithMemory(memory interfaces.Memory) Option
- func WithName(name string) Option
- func WithOrgID(orgID string) Option
- func WithRemoteTimeout(timeout time.Duration) Option
- func WithRequirePlanApproval(require bool) Option
- func WithResponseFormat(formatType interfaces.ResponseFormat) Option
- func WithStreamConfig(config *interfaces.StreamConfig) Option
- func WithSystemPrompt(prompt string) Option
- func WithTools(tools ...interfaces.Tool) Option
- func WithTracer(tracer interfaces.Tracer) Option
- func WithURL(url string) Option
- type ResponseFormatConfig
- type RuntimeConfigYAML
- type StreamConfigYAML
- type SubAgentContext
- type TaskConfig
- type TaskConfigs
- type ToolConfigYAML
- type ToolFactory
- func (tf *ToolFactory) CreateTool(config ToolConfigYAML) (interfaces.Tool, error)
- func (tf *ToolFactory) CreateToolWithParentConfig(config ToolConfigYAML, parentConfig *AgentConfig) (interfaces.Tool, error)
- func (tf *ToolFactory) RegisterCustomTool(name string, factory func(map[string]interface{}) (interfaces.Tool, error))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertYAMLSchemaToResponseFormat ¶ added in v0.0.24
func ConvertYAMLSchemaToResponseFormat(config *ResponseFormatConfig) (*interfaces.ResponseFormat, error)
ConvertYAMLSchemaToResponseFormat converts a ResponseFormatConfig to interfaces.ResponseFormat
func CreateMemoryFromConfig ¶ added in v0.2.4
func CreateMemoryFromConfig(memoryConfig map[string]interface{}, llmClient interfaces.LLM) (interfaces.Memory, error)
CreateMemoryFromConfig creates a memory instance from YAML configuration This function is intended to be used by agent-blueprint applications that need to instantiate memory from YAML config stored in the agent
func ExpandEnv ¶ added in v0.2.4
ExpandEnv expands environment variables, checking both actual env vars and .env file This replaces os.ExpandEnv to support .env files
func FormatSystemPromptFromConfig ¶ added in v0.0.3
func FormatSystemPromptFromConfig(config AgentConfig, variables map[string]string) string
FormatSystemPromptFromConfig formats a system prompt based on the agent configuration
func GenerateConfigFromSystemPrompt ¶ added in v0.0.3
func GenerateConfigFromSystemPrompt(ctx context.Context, llm interfaces.LLM, systemPrompt string) (AgentConfig, []TaskConfig, error)
GenerateConfigFromSystemPrompt uses the LLM to generate agent and task configurations from a system prompt
func GetAgentForTask ¶ added in v0.0.3
func GetAgentForTask(taskConfigs TaskConfigs, taskName string) (string, error)
GetAgentForTask returns the agent name for a given task
func GetEnvValue ¶ added in v0.2.4
GetEnvValue gets an environment variable value from either env or .env cache
func GetInvocationID ¶ added in v0.0.26
GetInvocationID retrieves the invocation ID from context
func GetParentAgent ¶ added in v0.0.26
GetParentAgent retrieves the parent agent from context
func GetRecursionDepth ¶ added in v0.0.26
GetRecursionDepth retrieves the current recursion depth from context
func GetSubAgentName ¶ added in v0.0.26
GetSubAgentName retrieves the sub-agent name from context
func IsSubAgentCall ¶ added in v0.0.26
IsSubAgentCall checks if the current context is a sub-agent call
func LoadEnvFile ¶ added in v0.2.4
LoadEnvFile explicitly loads a .env file into the cache This can be called by applications to ensure a specific .env file is loaded
func SaveAgentConfigsToFile ¶ added in v0.0.3
func SaveAgentConfigsToFile(configs AgentConfigs, file *os.File) error
SaveAgentConfigsToFile saves agent configurations to a YAML file
func SaveMCPConfigToJSON ¶ added in v0.1.14
func SaveMCPConfigToJSON(config *MCPConfiguration, filePath string) error
SaveMCPConfigToJSON saves MCP configuration to a JSON file
func SaveMCPConfigToYAML ¶ added in v0.1.14
func SaveMCPConfigToYAML(config *MCPConfiguration, filePath string) error
SaveMCPConfigToYAML saves MCP configuration to a YAML file
func SaveTaskConfigsToFile ¶ added in v0.0.3
func SaveTaskConfigsToFile(configs TaskConfigs, file *os.File) error
SaveTaskConfigsToFile saves task configurations to a YAML file
func ValidateMCPConfig ¶ added in v0.1.14
func ValidateMCPConfig(config *MCPConfiguration) error
ValidateMCPConfig validates an MCP configuration
func ValidateRecursionDepth ¶ added in v0.0.26
ValidateRecursionDepth checks if the recursion depth is within limits
func WithSubAgentContext ¶ added in v0.0.26
WithSubAgentContext adds sub-agent context to the context
func WithTimeout ¶ added in v0.0.26
WithTimeout adds a timeout to the context for sub-agent calls
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent represents an AI agent
func CreateAgentForTask ¶ added in v0.0.3
func CreateAgentForTask(taskName string, agentConfigs AgentConfigs, taskConfigs TaskConfigs, variables map[string]string, options ...Option) (*Agent, error)
CreateAgentForTask creates a new agent for a specific task
func NewAgentFromConfig ¶ added in v0.0.3
func NewAgentFromConfig(agentName string, configs AgentConfigs, variables map[string]string, options ...Option) (*Agent, error)
NewAgentFromConfig creates a new agent from a YAML configuration
func NewAgentWithAutoConfig ¶ added in v0.0.3
NewAgentWithAutoConfig creates a new agent with automatic configuration generation based on the system prompt if explicit configuration is not provided
func (*Agent) ApproveExecutionPlan ¶ added in v0.0.2
func (a *Agent) ApproveExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan) (string, error)
ApproveExecutionPlan approves an execution plan for execution
func (*Agent) Disconnect ¶ added in v0.0.26
Disconnect closes the connection to a remote agent
func (*Agent) ExecuteTaskFromConfig ¶ added in v0.0.3
func (a *Agent) ExecuteTaskFromConfig(ctx context.Context, taskName string, taskConfigs TaskConfigs, variables map[string]string) (string, error)
ExecuteTaskFromConfig executes a task using its YAML configuration
func (*Agent) GenerateExecutionPlan ¶ added in v0.0.2
func (a *Agent) GenerateExecutionPlan(ctx context.Context, input string) (*executionplan.ExecutionPlan, error)
GenerateExecutionPlan generates an execution plan
func (*Agent) GetAllConversations ¶ added in v0.1.7
GetAllConversations returns all conversation IDs from memory
func (*Agent) GetCapabilities ¶ added in v0.0.20
GetCapabilities returns a description of what the agent can do
func (*Agent) GetConversationMessages ¶ added in v0.1.7
func (a *Agent) GetConversationMessages(ctx context.Context, conversationID string) ([]interfaces.Message, error)
GetConversationMessages gets all messages for a specific conversation
func (*Agent) GetDescription ¶ added in v0.0.20
GetDescription returns the description of the agent
func (*Agent) GetGeneratedAgentConfig ¶ added in v0.0.3
func (a *Agent) GetGeneratedAgentConfig() *AgentConfig
GetGeneratedAgentConfig returns the automatically generated agent configuration, if any
func (*Agent) GetGeneratedTaskConfigs ¶ added in v0.0.3
func (a *Agent) GetGeneratedTaskConfigs() TaskConfigs
GetGeneratedTaskConfigs returns the automatically generated task configurations, if any
func (*Agent) GetLLM ¶ added in v0.0.43
func (a *Agent) GetLLM() interfaces.LLM
GetLLM returns the LLM instance (for use in custom functions)
func (*Agent) GetLogger ¶ added in v0.0.43
GetLogger returns the logger instance (for use in custom functions)
func (*Agent) GetMemory ¶ added in v0.0.43
func (a *Agent) GetMemory() interfaces.Memory
GetMemory returns the memory instance (for use in custom functions)
func (*Agent) GetMemoryConfig ¶ added in v0.2.4
GetMemoryConfig returns the stored memory configuration from YAML This allows agent-blueprint to access the memory config for instantiation
func (*Agent) GetMemoryStatistics ¶ added in v0.1.7
func (a *Agent) GetMemoryStatistics(ctx context.Context) (totalConversations, totalMessages int, err error)
GetMemoryStatistics returns basic memory statistics
func (*Agent) GetRemoteMetadata ¶ added in v0.1.7
GetRemoteMetadata returns metadata for remote agents, nil for local agents
func (*Agent) GetRemoteURL ¶ added in v0.0.26
GetRemoteURL returns the URL of the remote agent (empty string if not remote)
func (*Agent) GetSubAgent ¶ added in v0.0.26
GetSubAgent retrieves a sub-agent by name
func (*Agent) GetSubAgents ¶ added in v0.0.26
GetSubAgents returns the sub-agents slice
func (*Agent) GetSystemPrompt ¶ added in v0.0.43
GetSystemPrompt returns the system prompt (for use in custom functions)
func (*Agent) GetTaskByID ¶ added in v0.0.2
func (a *Agent) GetTaskByID(taskID string) (*executionplan.ExecutionPlan, bool)
GetTaskByID returns a task by its ID
func (*Agent) GetTools ¶ added in v0.0.43
func (a *Agent) GetTools() []interfaces.Tool
GetTools returns the tools slice (for use in custom functions)
func (*Agent) GetTracer ¶ added in v0.0.43
func (a *Agent) GetTracer() interfaces.Tracer
GetTracer returns the tracer instance (for use in custom functions)
func (*Agent) HasSubAgent ¶ added in v0.0.26
HasSubAgent checks if a specific agent is a sub-agent
func (*Agent) ListTasks ¶ added in v0.0.2
func (a *Agent) ListTasks() []*executionplan.ExecutionPlan
ListTasks returns a list of all tasks
func (*Agent) ModifyExecutionPlan ¶ added in v0.0.2
func (a *Agent) ModifyExecutionPlan(ctx context.Context, plan *executionplan.ExecutionPlan, modifications string) (*executionplan.ExecutionPlan, error)
ModifyExecutionPlan modifies an execution plan based on user input
func (*Agent) RunDetailed ¶ added in v0.1.13
func (a *Agent) RunDetailed(ctx context.Context, input string) (*interfaces.AgentResponse, error)
func (*Agent) RunStream ¶ added in v0.0.34
func (a *Agent) RunStream(ctx context.Context, input string) (<-chan interfaces.AgentStreamEvent, error)
RunStream executes the agent with streaming response
func (*Agent) RunStreamWithAuth ¶ added in v0.0.35
func (a *Agent) RunStreamWithAuth(ctx context.Context, input string, authToken string) (<-chan interfaces.AgentStreamEvent, error)
RunStreamWithAuth executes the agent with streaming response and explicit auth token
func (*Agent) RunWithAuth ¶ added in v0.0.29
func (*Agent) RunWithAuthDetailed ¶ added in v0.1.13
func (a *Agent) RunWithAuthDetailed(ctx context.Context, input string, authToken string) (*interfaces.AgentResponse, error)
type AgentConfig ¶ added in v0.0.3
type AgentConfig struct {
Role string `yaml:"role"`
Goal string `yaml:"goal"`
Backstory string `yaml:"backstory"`
ResponseFormat *ResponseFormatConfig `yaml:"response_format,omitempty"`
MCP *MCPConfiguration `yaml:"mcp,omitempty"`
// NEW: Behavioral settings
MaxIterations *int `yaml:"max_iterations,omitempty"`
RequirePlanApproval *bool `yaml:"require_plan_approval,omitempty"`
// NEW: Complex configuration objects
StreamConfig *StreamConfigYAML `yaml:"stream_config,omitempty"`
LLMConfig *LLMConfigYAML `yaml:"llm_config,omitempty"`
// NEW: LLM Provider configuration
LLMProvider *LLMProviderYAML `yaml:"llm_provider,omitempty"`
// NEW: Tool configurations
Tools []ToolConfigYAML `yaml:"tools,omitempty"`
// NEW: Memory configuration (config only)
Memory *MemoryConfigYAML `yaml:"memory,omitempty"`
// NEW: Runtime settings
Runtime *RuntimeConfigYAML `yaml:"runtime,omitempty"`
// NEW: Sub-agents configuration (recursive)
SubAgents map[string]AgentConfig `yaml:"sub_agents,omitempty"`
}
AgentConfig represents the configuration for an agent loaded from YAML
type AgentConfigs ¶ added in v0.0.3
type AgentConfigs map[string]AgentConfig
AgentConfigs represents a map of agent configurations
func LoadAgentConfigsFromDir ¶ added in v0.0.3
func LoadAgentConfigsFromDir(dirPath string) (AgentConfigs, error)
LoadAgentConfigsFromDir loads all agent configurations from YAML files in a directory
func LoadAgentConfigsFromFile ¶ added in v0.0.3
func LoadAgentConfigsFromFile(filePath string) (AgentConfigs, error)
LoadAgentConfigsFromFile loads agent configurations from a YAML file
type AgentToolWrapper ¶ added in v0.2.4
type AgentToolWrapper struct {
// contains filtered or unexported fields
}
AgentToolWrapper is a simple wrapper for agent tools (placeholder implementation) This would normally use the actual tools.AgentTool implementation
func (*AgentToolWrapper) Description ¶ added in v0.2.4
func (atw *AgentToolWrapper) Description() string
Description implements interfaces.Tool.Description
func (*AgentToolWrapper) Name ¶ added in v0.2.4
func (atw *AgentToolWrapper) Name() string
Name implements interfaces.Tool.Name
func (*AgentToolWrapper) Parameters ¶ added in v0.2.4
func (atw *AgentToolWrapper) Parameters() map[string]interfaces.ParameterSpec
Parameters implements interfaces.Tool.Parameters
type ContextKey ¶ added in v0.0.26
type ContextKey string
ContextKey is a type for context keys to avoid collisions
const ( // SubAgentNameKey is the context key for sub-agent name SubAgentNameKey ContextKey = "sub_agent_name" // ParentAgentKey is the context key for parent agent ParentAgentKey ContextKey = "parent_agent" // RecursionDepthKey is the context key for recursion depth RecursionDepthKey ContextKey = "recursion_depth" // InvocationIDKey is the context key for invocation ID InvocationIDKey ContextKey = "invocation_id" // MaxRecursionDepth is the maximum allowed recursion depth MaxRecursionDepth = 5 // DefaultSubAgentTimeout is the default timeout for sub-agent calls DefaultSubAgentTimeout = 30 * time.Second )
type CustomRunFunction ¶ added in v0.0.43
CustomRunFunction represents a custom function that can replace the default Run behavior
type CustomRunStreamFunction ¶ added in v0.0.43
type CustomRunStreamFunction func(ctx context.Context, input string, agent *Agent) (<-chan interfaces.AgentStreamEvent, error)
CustomRunStreamFunction represents a custom function that can replace the default RunStream behavior
type LLMConfigYAML ¶ added in v0.2.4
type LLMConfigYAML struct {
Temperature *float64 `yaml:"temperature,omitempty"`
TopP *float64 `yaml:"top_p,omitempty"`
FrequencyPenalty *float64 `yaml:"frequency_penalty,omitempty"`
PresencePenalty *float64 `yaml:"presence_penalty,omitempty"`
StopSequences []string `yaml:"stop_sequences,omitempty"`
EnableReasoning *bool `yaml:"enable_reasoning,omitempty"`
ReasoningBudget *int `yaml:"reasoning_budget,omitempty"`
Reasoning *string `yaml:"reasoning,omitempty"`
}
LLMConfigYAML represents LLM configuration in YAML
type LLMProviderYAML ¶ added in v0.2.4
type LLMProviderYAML struct {
Provider string `yaml:"provider"`
Model string `yaml:"model,omitempty"`
Config map[string]interface{} `yaml:"config,omitempty"`
}
LLMProviderYAML represents LLM provider configuration in YAML
type LazyMCPConfig ¶ added in v0.0.42
type LazyMCPConfig struct {
Name string
Type string // "stdio" or "http"
Command string
Args []string
Env []string
URL string
Tools []LazyMCPToolConfig
}
LazyMCPConfig holds configuration for lazy MCP server initialization
type LazyMCPToolConfig ¶ added in v0.0.42
LazyMCPToolConfig holds configuration for a lazy MCP tool
type MCPConfiguration ¶ added in v0.1.14
type MCPConfiguration struct {
MCPServers map[string]MCPServerConfig `json:"mcpServers" yaml:"mcpServers"`
Global *MCPGlobalConfig `json:"global,omitempty" yaml:"global,omitempty"`
}
MCPConfiguration represents the complete MCP configuration
func GetMCPConfigFromAgent ¶ added in v0.1.14
func GetMCPConfigFromAgent(a *Agent) *MCPConfiguration
GetMCPConfigFromAgent extracts MCP configuration from an agent
func LoadMCPConfigFromJSON ¶ added in v0.1.14
func LoadMCPConfigFromJSON(filePath string) (*MCPConfiguration, error)
LoadMCPConfigFromJSON loads MCP configuration from a JSON file
func LoadMCPConfigFromYAML ¶ added in v0.1.14
func LoadMCPConfigFromYAML(filePath string) (*MCPConfiguration, error)
LoadMCPConfigFromYAML loads MCP configuration from a YAML file
type MCPDiscoveredCapabilities ¶ added in v0.1.14
type MCPDiscoveredCapabilities struct {
SupportsTools bool `json:"supportsTools,omitempty"`
SupportsResources bool `json:"supportsResources,omitempty"`
SupportsPrompts bool `json:"supportsPrompts,omitempty"`
}
MCPDiscoveredCapabilities represents capabilities discovered from the server
type MCPDiscoveredServerInfo ¶ added in v0.1.14
type MCPDiscoveredServerInfo struct {
Name string `json:"name,omitempty"`
Title string `json:"title,omitempty"`
Version string `json:"version,omitempty"`
Capabilities *MCPDiscoveredCapabilities `json:"capabilities,omitempty"`
}
MCPDiscoveredServerInfo represents metadata discovered from the server at runtime
type MCPGlobalConfig ¶ added in v0.1.14
type MCPGlobalConfig struct {
Timeout string `json:"timeout,omitempty" yaml:"timeout,omitempty"` // e.g., "30s"
RetryAttempts int `json:"retry_attempts,omitempty" yaml:"retry_attempts,omitempty"`
HealthCheck *bool `json:"health_check,omitempty" yaml:"health_check,omitempty"`
EnableResources *bool `json:"enable_resources,omitempty" yaml:"enable_resources,omitempty"`
EnablePrompts *bool `json:"enable_prompts,omitempty" yaml:"enable_prompts,omitempty"`
EnableSampling *bool `json:"enable_sampling,omitempty" yaml:"enable_sampling,omitempty"`
EnableSchemas *bool `json:"enable_schemas,omitempty" yaml:"enable_schemas,omitempty"`
LogLevel string `json:"log_level,omitempty" yaml:"log_level,omitempty"`
}
MCPGlobalConfig represents global MCP settings
type MCPServerConfig ¶ added in v0.1.14
type MCPServerConfig struct {
Command string `json:"command,omitempty" yaml:"command,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Env map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Token string `json:"token,omitempty" yaml:"token,omitempty"`
}
MCPServerConfig represents a single MCP server configuration
func (*MCPServerConfig) GetServerType ¶ added in v0.1.14
func (c *MCPServerConfig) GetServerType() string
GetServerType returns the server type based on configuration
type MemoryConfigYAML ¶ added in v0.2.4
type MemoryConfigYAML struct {
Type string `yaml:"type"` // "buffer", "redis", "vector"
Config map[string]interface{} `yaml:"config,omitempty"`
}
MemoryConfigYAML represents memory configuration in YAML
type Option ¶
type Option func(*Agent)
Option represents an option for configuring an agent
func WithAgentConfig ¶ added in v0.0.3
func WithAgentConfig(config AgentConfig, variables map[string]string) Option
WithAgentConfig sets the agent configuration from a YAML config
func WithAgents ¶ added in v0.0.26
WithAgents sets the sub-agents that can be called as tools
func WithCustomRunFunction ¶ added in v0.0.43
func WithCustomRunFunction(fn CustomRunFunction) Option
WithCustomRunFunction sets a custom run function that replaces the default Run behavior
func WithCustomRunStreamFunction ¶ added in v0.0.43
func WithCustomRunStreamFunction(fn CustomRunStreamFunction) Option
WithCustomRunStreamFunction sets a custom streaming run function that replaces the default RunStream behavior
func WithDescription ¶ added in v0.0.20
WithDescription sets the description for the agent
func WithGuardrails ¶
func WithGuardrails(guardrails interfaces.Guardrails) Option
WithGuardrails sets the guardrails for the agent
func WithLLMConfig ¶ added in v0.0.11
func WithLLMConfig(config interfaces.LLMConfig) Option
func WithLazyMCPConfigs ¶ added in v0.0.42
func WithLazyMCPConfigs(configs []LazyMCPConfig) Option
WithLazyMCPConfigs sets the lazy MCP server configurations for the agent
func WithLogger ¶ added in v0.0.36
WithLogger sets the logger for the agent
func WithMCPConfig ¶ added in v0.1.14
func WithMCPConfig(config *MCPConfiguration) Option
WithMCPConfig adds MCP servers from configuration object
func WithMCPConfigFromJSON ¶ added in v0.1.14
WithMCPConfigFromJSON adds MCP servers from a JSON configuration file
func WithMCPConfigFromYAML ¶ added in v0.1.14
WithMCPConfigFromYAML adds MCP servers from a YAML configuration file
func WithMCPPresets ¶ added in v0.1.14
WithMCPPresets adds predefined MCP server configurations
func WithMCPServers ¶ added in v0.0.13
func WithMCPServers(mcpServers []interfaces.MCPServer) Option
WithMCPServers sets the MCP servers for the agent
func WithMCPURLs ¶ added in v0.1.14
WithMCPURLs adds MCP servers from URL strings Supports formats: - stdio://command/path/to/executable - http://localhost:8080/mcp - https://api.example.com/mcp?token=xxx - mcp://preset-name (for presets)
func WithMaxIterations ¶ added in v0.0.19
WithMaxIterations sets the maximum number of tool-calling iterations for the agent
func WithMemory ¶
func WithMemory(memory interfaces.Memory) Option
WithMemory sets the memory for the agent
func WithRemoteTimeout ¶ added in v0.0.29
WithRemoteTimeout sets the timeout for remote agent operations
func WithRequirePlanApproval ¶ added in v0.0.2
WithRequirePlanApproval sets whether execution plans require user approval
func WithResponseFormat ¶ added in v0.0.4
func WithResponseFormat(formatType interfaces.ResponseFormat) Option
WithResponseFormat sets the response format for the agent
func WithStreamConfig ¶ added in v0.0.46
func WithStreamConfig(config *interfaces.StreamConfig) Option
WithStreamConfig sets the streaming configuration for the agent
func WithSystemPrompt ¶
WithSystemPrompt sets the system prompt for the agent
func WithTools ¶
func WithTools(tools ...interfaces.Tool) Option
WithTools sets the tools for the agent
func WithTracer ¶
func WithTracer(tracer interfaces.Tracer) Option
WithTracer sets the tracer for the agent
type ResponseFormatConfig ¶ added in v0.0.24
type ResponseFormatConfig struct {
Type string `yaml:"type"`
SchemaName string `yaml:"schema_name"`
SchemaDefinition map[string]interface{} `yaml:"schema_definition"`
}
ResponseFormatConfig represents the configuration for the response format of an agent or task
type RuntimeConfigYAML ¶ added in v0.2.4
type RuntimeConfigYAML struct {
LogLevel string `yaml:"log_level,omitempty"` // "debug", "info", "warn", "error"
EnableTracing *bool `yaml:"enable_tracing,omitempty"`
EnableMetrics *bool `yaml:"enable_metrics,omitempty"`
TimeoutDuration string `yaml:"timeout_duration,omitempty"` // "30s", "5m"
}
RuntimeConfigYAML represents runtime behavior settings in YAML
type StreamConfigYAML ¶ added in v0.2.4
type StreamConfigYAML struct {
BufferSize *int `yaml:"buffer_size,omitempty"`
IncludeToolProgress *bool `yaml:"include_tool_progress,omitempty"`
IncludeIntermediateMessages *bool `yaml:"include_intermediate_messages,omitempty"`
}
StreamConfigYAML represents streaming configuration in YAML
type SubAgentContext ¶ added in v0.0.26
type SubAgentContext struct {
ParentAgent string
SubAgentName string
RecursionDepth int
InvocationID string
StartTime time.Time
}
SubAgentContext contains context information for sub-agent invocations
type TaskConfig ¶ added in v0.0.3
type TaskConfig struct {
Description string `yaml:"description"`
ExpectedOutput string `yaml:"expected_output"`
Agent string `yaml:"agent"`
OutputFile string `yaml:"output_file,omitempty"`
ResponseFormat *ResponseFormatConfig `yaml:"response_format,omitempty"`
}
TaskConfig represents a task definition loaded from YAML
type TaskConfigs ¶ added in v0.0.3
type TaskConfigs map[string]TaskConfig
TaskConfigs represents a map of task configurations
func LoadTaskConfigsFromDir ¶ added in v0.0.3
func LoadTaskConfigsFromDir(dirPath string) (TaskConfigs, error)
LoadTaskConfigsFromDir loads all task configurations from YAML files in a directory
func LoadTaskConfigsFromFile ¶ added in v0.0.3
func LoadTaskConfigsFromFile(filePath string) (TaskConfigs, error)
LoadTaskConfigsFromFile loads task configurations from a YAML file
type ToolConfigYAML ¶ added in v0.2.4
type ToolConfigYAML struct {
Type string `yaml:"type"` // "builtin", "custom", "mcp", "agent"
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
Config map[string]interface{} `yaml:"config,omitempty"`
Enabled *bool `yaml:"enabled,omitempty"`
// For agent tools
URL string `yaml:"url,omitempty"` // Remote agent URL
Timeout string `yaml:"timeout,omitempty"` // Timeout duration
}
ToolConfigYAML represents tool configuration in YAML
type ToolFactory ¶ added in v0.2.4
type ToolFactory struct {
// contains filtered or unexported fields
}
ToolFactory creates tools from YAML configuration
func NewToolFactory ¶ added in v0.2.4
func NewToolFactory() *ToolFactory
NewToolFactory creates a new tool factory with builtin tools registered
func (*ToolFactory) CreateTool ¶ added in v0.2.4
func (tf *ToolFactory) CreateTool(config ToolConfigYAML) (interfaces.Tool, error)
CreateTool creates a tool from YAML configuration
func (*ToolFactory) CreateToolWithParentConfig ¶ added in v0.2.4
func (tf *ToolFactory) CreateToolWithParentConfig(config ToolConfigYAML, parentConfig *AgentConfig) (interfaces.Tool, error)
CreateToolWithParentConfig creates a tool from YAML configuration with access to parent agent config
func (*ToolFactory) RegisterCustomTool ¶ added in v0.2.4
func (tf *ToolFactory) RegisterCustomTool(name string, factory func(map[string]interface{}) (interfaces.Tool, error))
RegisterCustomTool allows external registration of custom tools