config

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandEnvVars

func ExpandEnvVars(s string) string

func GetConfigPaths

func GetConfigPaths() []string

Types

type Config

type Config struct {
	DefaultProvider       string                    `yaml:"default_provider"`
	DefaultTargetLanguage string                    `yaml:"default_target_language"`
	Settings              Settings                  `yaml:"settings"`
	StrongValidation      StrongValidation          `yaml:"strong_validation"`
	Proxy                 ProxyConfig               `yaml:"proxy"`
	Providers             map[string]ProviderConfig `yaml:"providers"`
	Prompts               Prompts                   `yaml:"prompts"`
	Glossary              []GlossaryEntry           `yaml:"glossary"`
}

func DefaultConfig

func DefaultConfig() *Config

func Load

func Load(configPath string) (*Config, error)

type GlossaryEntry

type GlossaryEntry struct {
	Term          string `yaml:"term"`
	Source        string `yaml:"source"`
	Target        string `yaml:"target"`
	Translation   string `yaml:"translation"`
	Note          string `yaml:"note"`
	CaseSensitive bool   `yaml:"case_sensitive"`
	Context       string `yaml:"context"`
}

type Prompts

type Prompts struct {
	System string            `yaml:"system"`
	Styles map[string]string `yaml:"styles"`
}

type ProviderConfig

type ProviderConfig struct {
	APIKey  string      `yaml:"api_key"`
	BaseURL string      `yaml:"base_url"`
	Model   string      `yaml:"model"`
	Proxy   ProxyConfig `yaml:"proxy"`
}

type ProxyConfig

type ProxyConfig struct {
	URL      string   `yaml:"url"`
	Username string   `yaml:"username"`
	Password string   `yaml:"password"`
	NoProxy  []string `yaml:"no_proxy"`
}

type Settings

type Settings struct {
	Temperature    float64 `yaml:"temperature"`
	MaxTokens      int     `yaml:"max_tokens"`
	Timeout        int     `yaml:"timeout"`
	ChunkSize      int     `yaml:"chunk_size"`
	PreserveFormat bool    `yaml:"preserve_format"`
	RetryCount     int     `yaml:"retry_count"`
	RetryDelay     int     `yaml:"retry_delay"`
	Sentiment      bool    `yaml:"sentiment"`
	TagsCount      int     `yaml:"tags_count"`
	Classify       bool    `yaml:"classify"`
	Emotions       bool    `yaml:"emotions"`
	Factuality     bool    `yaml:"factuality"`
	Impact         bool    `yaml:"impact"`
	Sensationalism bool    `yaml:"sensationalism"`
	Entities       bool    `yaml:"entities"`
	Events         bool    `yaml:"events"`
	Usefulness     bool    `yaml:"usefulness"`
	TimeFocus      bool    `yaml:"time_focus"`
	AdDetect       bool    `yaml:"ad_detect"`
}

type StrongValidation

type StrongValidation struct {
	Enabled         bool     `yaml:"enabled"`
	MaxRetries      int      `yaml:"max_retries"`
	AllowedPatterns []string `yaml:"allowed_patterns"`
	AllowedTerms    []string `yaml:"allowed_terms"`
}

Jump to

Keyboard shortcuts

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