config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateRoutingPolicy

func ValidateRoutingPolicy(policy RoutingPolicy, registeredModels map[string]struct{}) error

Types

type Config

type Config struct {
	Host                     string
	Port                     string
	EnableDebug              bool
	DefaultProvider          string
	Timeout                  time.Duration
	APIToken                 string
	RouterModel              string
	SynthesisModel           string
	RoutingConfigPath        string
	ConversationDBPath       string
	ConversationTTL          time.Duration
	RequireConversationScope bool
	FallbackEnabled          *bool
	FallbackMaxRetries       *int
	FallbackMaxModels        *int
}

func Load

func Load() (*Config, error)

func (*Config) Validate

func (c *Config) Validate() error

type EnsemblePolicy added in v0.1.3

type EnsemblePolicy struct {
	Mode           string `json:"mode,omitempty"`
	CandidateCount *int   `json:"candidate_count,omitempty"`
	ChainAgents    *int   `json:"chain_agents,omitempty"`
	DebateTurns    *int   `json:"debate_turns,omitempty"`
}

type ModelDescriptor

type ModelDescriptor struct {
	Description  string   `json:"description,omitempty"`
	Capabilities []string `json:"capabilities,omitempty"`
}

type RoutingFallback

type RoutingFallback struct {
	Enabled           *bool               `json:"enabled,omitempty"`
	MaxRetries        *int                `json:"max_retries,omitempty"`
	MaxFallbackModels *int                `json:"max_fallback_models,omitempty"`
	Models            map[string][]string `json:"models,omitempty"`
}

type RoutingPolicy

type RoutingPolicy struct {
	Models         map[string]ModelDescriptor `json:"models"`
	Profiles       map[string]TaskRule        `json:"profiles,omitempty"`
	Tasks          map[string]TaskRule        `json:"tasks,omitempty"` // legacy alias for Profiles
	DefaultProfile string                     `json:"default_profile,omitempty"`
	Ensemble       *EnsemblePolicy            `json:"ensemble,omitempty"`
	// Fallback overrides the global fallback policy per routing model. Its
	// pointer fields (enabled, max_retries, max_fallback_models) override
	// environment and defaults; Models maps a routed model ID to an ordered
	// list of fallback model IDs.
	Fallback *RoutingFallback `json:"fallback,omitempty"`
}

func LoadRoutingPolicy

func LoadRoutingPolicy(path string) (RoutingPolicy, error)

type TaskRule

type TaskRule struct {
	RequiredCapabilities []string `json:"required_capabilities,omitempty"`
	PreferredModels      []string `json:"preferred_models,omitempty"`
	Selection            string   `json:"selection,omitempty"`
}

Jump to

Keyboard shortcuts

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