Documentation
¶
Overview ¶
Package yamlconfig parses DraftCrew YAML configuration files into Go structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToCrewConfig ¶
func ToCrewConfig(cfg *CrewConfig) (*crew.Config, *MCPSetup, *EvalConfig, error)
ToCrewConfig converts a parsed CrewConfig into runtime types. Returns crew.Config, optional MCPSetup, optional EvalConfig, and error.
Types ¶
type AgentConfig ¶
type AgentConfig struct {
Role string `yaml:"role"`
Goal string `yaml:"goal"`
Backstory string `yaml:"backstory,omitempty"`
LLM *LLMConfig `yaml:"llm,omitempty"`
Tools []string `yaml:"tools,omitempty"`
MaxIter int `yaml:"max_iter,omitempty"`
AllowDelegation bool `yaml:"allow_delegation,omitempty"`
}
AgentConfig describes an agent in YAML.
type CrewConfig ¶
type CrewConfig struct {
SchemaVersion string `yaml:"schema_version,omitempty"`
LLM *LLMConfig `yaml:"llm,omitempty"`
Agents []AgentConfig `yaml:"agents"`
Tasks []TaskConfig `yaml:"tasks"`
Process string `yaml:"process"`
MCPServers []MCPServerConfig `yaml:"mcp_servers,omitempty"`
Eval *EvalConfig `yaml:"eval,omitempty"`
FlowEdges []FlowEdgeConfig `yaml:"flow_edges,omitempty"`
}
CrewConfig represents the root structure of a crew.yaml file.
func Parse ¶
func Parse(data []byte) (*CrewConfig, error)
Parse unmarshals YAML data into a CrewConfig.
func ParseDir ¶
func ParseDir(dir string) (*CrewConfig, error)
ParseDir reads all YAML files from a directory and merges them.
func ParseFile ¶
func ParseFile(path string) (*CrewConfig, error)
ParseFile reads and parses a single YAML file.
func ParseFiles ¶
func ParseFiles(paths ...string) (*CrewConfig, error)
ParseFiles parses and merges multiple YAML files.
type EvalConfig ¶
type EvalConfig struct {
Criteria []EvalCriterionConfig `yaml:"criteria,omitempty"`
}
EvalConfig describes eval criteria in YAML.
type EvalCriterionConfig ¶
type EvalCriterionConfig struct {
Type string `yaml:"type"`
Value string `yaml:"value,omitempty"`
Prompt string `yaml:"prompt,omitempty"`
Task string `yaml:"task,omitempty"`
}
EvalCriterionConfig describes a single eval criterion.
type FlowEdgeConditionConfig ¶ added in v0.6.0
type FlowEdgeConditionConfig struct {
Field string `yaml:"field"`
Operator string `yaml:"operator"`
Value string `yaml:"value"`
}
FlowEdgeConditionConfig describes a condition for a flow edge in YAML.
type FlowEdgeConfig ¶ added in v0.6.0
type FlowEdgeConfig struct {
From string `yaml:"from"`
To string `yaml:"to"`
Condition *FlowEdgeConditionConfig `yaml:"condition,omitempty"`
}
FlowEdgeConfig describes a flow edge in YAML.
type LLMConfig ¶
type LLMConfig struct {
Provider string `yaml:"provider"`
Model string `yaml:"model,omitempty"`
APIKey string `yaml:"api_key"`
BaseURL string `yaml:"base_url,omitempty"`
Temperature float64 `yaml:"temperature,omitempty"`
Region string `yaml:"region,omitempty"` // Bedrock
ProjectID string `yaml:"project_id,omitempty"` // Vertex AI
Location string `yaml:"location,omitempty"` // Vertex AI
}
LLMConfig describes an LLM provider configuration in YAML.
type MCPServerConfig ¶
type MCPServerConfig struct {
Transport string `yaml:"transport"`
Command string `yaml:"command,omitempty"`
Args []string `yaml:"args,omitempty"`
URL string `yaml:"url,omitempty"`
}
MCPServerConfig describes an MCP server connection in YAML.
type MCPSetup ¶
type MCPSetup struct {
Servers []MCPServerConfig
}
MCPSetup holds the parsed MCP server configurations for the CLI.
type TaskConfig ¶
type TaskConfig struct {
Description string `yaml:"description"`
Agent string `yaml:"agent"`
Context []string `yaml:"context,omitempty"`
ExpectedOutput string `yaml:"expected_output,omitempty"`
FlowNodeID string `yaml:"flow_node_id,omitempty"`
}
TaskConfig describes a task in YAML.