config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureConfigExists added in v0.14.0

func EnsureConfigExists() error

EnsureConfigExists checks if a config file exists and creates a default one if not

func LoadSystemPrompt

func LoadSystemPrompt(input string) (string, error)

LoadSystemPrompt loads system prompt from file or returns the string directly

Types

type Config

type Config struct {
	MCPServers     map[string]MCPServerConfig `json:"mcpServers" yaml:"mcpServers"`
	Model          string                     `json:"model,omitempty" yaml:"model,omitempty"`
	MaxSteps       int                        `json:"max-steps,omitempty" yaml:"max-steps,omitempty"`
	Debug          bool                       `json:"debug,omitempty" yaml:"debug,omitempty"`
	SystemPrompt   string                     `json:"system-prompt,omitempty" yaml:"system-prompt,omitempty"`
	ProviderAPIKey string                     `json:"provider-api-key,omitempty" yaml:"provider-api-key,omitempty"`
	ProviderURL    string                     `json:"provider-url,omitempty" yaml:"provider-url,omitempty"`
	Prompt         string                     `json:"prompt,omitempty" yaml:"prompt,omitempty"`
	NoExit         bool                       `json:"no-exit,omitempty" yaml:"no-exit,omitempty"`

	// Model generation parameters
	MaxTokens     int      `json:"max-tokens,omitempty" yaml:"max-tokens,omitempty"`
	Temperature   *float32 `json:"temperature,omitempty" yaml:"temperature,omitempty"`
	TopP          *float32 `json:"top-p,omitempty" yaml:"top-p,omitempty"`
	TopK          *int32   `json:"top-k,omitempty" yaml:"top-k,omitempty"`
	StopSequences []string `json:"stop-sequences,omitempty" yaml:"stop-sequences,omitempty"`
}

Config represents the application configuration

func (*Config) Validate added in v0.11.0

func (c *Config) Validate() error

Validate validates the configuration

type MCPServerConfig

type MCPServerConfig struct {
	Transport     string         `json:"transport,omitempty"`
	Command       string         `json:"command,omitempty"`
	Args          []string       `json:"args,omitempty"`
	Env           map[string]any `json:"env,omitempty"`
	URL           string         `json:"url,omitempty"`
	Headers       []string       `json:"headers,omitempty"`
	AllowedTools  []string       `json:"allowedTools,omitempty"`
	ExcludedTools []string       `json:"excludedTools,omitempty"`
}

MCPServerConfig represents configuration for an MCP server

func (*MCPServerConfig) GetTransportType added in v0.15.0

func (s *MCPServerConfig) GetTransportType() string

GetTransportType returns the transport type for the server config

Jump to

Keyboard shortcuts

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