yamlconfig

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

@sk-task ecosystem#T1.1: YAML config parser (AC-001, AC-002, AC-010)

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"`
}

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 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"`
}

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"`
}

TaskConfig describes a task in YAML.

Jump to

Keyboard shortcuts

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