v2

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	Model              string    `json:"model,omitempty" yaml:"model,omitempty"`
	Description        string    `json:"description,omitempty" yaml:"description,omitempty"`
	Toolsets           []Toolset `json:"toolsets,omitempty" yaml:"toolsets,omitempty"`
	Instruction        string    `json:"instruction,omitempty" yaml:"instruction,omitempty"`
	SubAgents          []string  `json:"sub_agents,omitempty" yaml:"sub_agents,omitempty"`
	AddDate            bool      `json:"add_date,omitempty" yaml:"add_date,omitempty"`
	AddEnvironmentInfo bool      `json:"add_environment_info,omitempty" yaml:"add_environment_info,omitempty"`
}

AgentConfig represents a single agent configuration

type Config

type Config struct {
	Agents   map[string]AgentConfig `json:"agents,omitempty" yaml:"agents,omitempty"`
	Models   map[string]ModelConfig `json:"models,omitempty" yaml:"models,omitempty"`
	Metadata Metadata               `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}

Config represents the entire configuration file

func Load

func Load(data []byte) (Config, error)

func UpgradeFrom

func UpgradeFrom(old v1.Config) (Config, error)

type Metadata

type Metadata struct {
	Author  string `json:"author,omitempty" yaml:"author,omitempty"`
	License string `json:"license,omitempty" yaml:"license,omitempty"`
	Readme  string `json:"readme,omitempty" yaml:"readme,omitempty"`
}

type ModelConfig

type ModelConfig struct {
	Provider          string  `json:"provider,omitempty" yaml:"provider,omitempty"`
	Model             string  `json:"model,omitempty" yaml:"model,omitempty"`
	Temperature       float64 `json:"temperature,omitempty" yaml:"temperature,omitempty"`
	MaxTokens         int     `json:"max_tokens,omitempty" yaml:"max_tokens,omitempty"`
	TopP              float64 `json:"top_p,omitempty" yaml:"top_p,omitempty"`
	FrequencyPenalty  float64 `json:"frequency_penalty,omitempty" yaml:"frequency_penalty,omitempty"`
	PresencePenalty   float64 `json:"presence_penalty,omitempty" yaml:"presence_penalty,omitempty"`
	BaseURL           string  `json:"base_url,omitempty" yaml:"base_url,omitempty"`
	ParallelToolCalls *bool   `json:"parallel_tool_calls,omitempty" yaml:"parallel_tool_calls,omitempty"`
	TokenKey          string  `json:"token_key,omitempty" yaml:"token_key,omitempty"`
	// ProviderOpts allows provider-specific options. Currently used for "dmr" provider only.
	ProviderOpts map[string]any `json:"provider_opts,omitempty" yaml:"provider_opts,omitempty"`
}

ModelConfig represents the configuration for a model

type Remote

type Remote struct {
	URL           string            `json:"url" yaml:"url"`
	TransportType string            `json:"transport_type,omitempty" yaml:"transport_type,omitempty"`
	Headers       map[string]string `json:"headers,omitempty" yaml:"headers,omitempty"`
}

type ScriptShellToolConfig

type ScriptShellToolConfig struct {
	Cmd         string `json:"cmd" yaml:"cmd"`
	Description string `json:"description" yaml:"description"`

	// Args is directly passed as "properties" in the JSON schema
	Args map[string]any `json:"args,omitempty" yaml:"args,omitempty"`

	// Required is directly passed as "required" in the JSON schema
	Required []string `json:"required" yaml:"required"`

	Env        map[string]string `json:"env,omitempty" yaml:"env,omitempty"`
	WorkingDir string            `json:"working_dir,omitempty" yaml:"working_dir,omitempty"`
}

ScriptShellToolConfig represents a custom shell tool configuration

type Toolset

type Toolset struct {
	Type    string            `json:"type,omitempty" yaml:"type,omitempty"`
	Ref     string            `json:"ref,omitempty" yaml:"ref,omitempty"`
	Config  any               `json:"config,omitempty" yaml:"config,omitempty"`
	Command string            `json:"command,omitempty" yaml:"command,omitempty"`
	Remote  Remote            `json:"remote,omitempty" yaml:"remote,omitempty"`
	Args    []string          `json:"args,omitempty" yaml:"args,omitempty"`
	Tools   []string          `json:"tools,omitempty" yaml:"tools,omitempty"`
	Env     map[string]string `json:"env,omitempty" yaml:"env,omitempty"`

	// For the think tool
	Shared bool `json:"shared,omitempty" yaml:"shared,omitempty"`
	// For the memory tool
	Path string `json:"path,omitempty" yaml:"path,omitempty"`

	// For the script tool
	Shell map[string]ScriptShellToolConfig `json:"shell,omitempty" yaml:"shell,omitempty"`
}

Toolset represents a tool configuration

func (*Toolset) UnmarshalYAML

func (t *Toolset) UnmarshalYAML(unmarshal func(any) error) error

Jump to

Keyboard shortcuts

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