config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEnvFile = ".env.local"

	ProviderFake             = catalog.ProviderFake
	ProviderOpenAICompatible = catalog.ProviderOpenAICompatible

	DefaultAgentProfileID     = "floret"
	DefaultFloretSystemPrompt = "You are Floret."
)

Variables

This section is empty.

Functions

func PromptCacheRetention

func PromptCacheRetention(cfg Config) cache.Retention

Types

type AgentProfile

type AgentProfile struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Description  string `json:"description,omitempty"`
	SystemPrompt string `json:"system_prompt"`
}

func DefaultFloretAgentProfile

func DefaultFloretAgentProfile() AgentProfile

func ResolveAgentProfile

func ResolveAgentProfile(profile AgentProfile, systemPrompt string) AgentProfile

type Config

type Config struct {
	Provider string
	Model    string
	BaseURL  string
	APIKey   string

	FakeResponse string

	RunID                   string
	PromptCacheDir          string
	PromptCacheRetention    string
	SystemPrompt            string
	AgentProfile            AgentProfile
	PromptIdentity          PromptIdentity
	SkillsEnabled           bool
	SkillSources            []string
	SkillPromptBudgetBytes  int
	ContextPolicy           contextpolicy.Policy
	MaxOutputTokensSet      bool
	MaxEmptyProviderRetries int
	NoProgressLimit         int
	DuplicateToolLimit      int
	WallTime                time.Duration
	// contains filtered or unexported fields
}

func Load

func Load(opts ...Option) (Config, error)

func Resolve

func Resolve(cfg Config, environ map[string]string) (Config, error)

func ResolveEnvSystemPrompt

func ResolveEnvSystemPrompt(systemPrompt string) Config

func ResolvePrompt

func ResolvePrompt(cfg Config) Config

type Option

type Option func(*loader)

func WithEnviron

func WithEnviron(environ map[string]string) Option

func WithPath

func WithPath(path string) Option

type PromptIdentity

type PromptIdentity struct {
	AgentProfileID   string       `json:"agent_profile_id"`
	AgentProfileName string       `json:"agent_profile_name"`
	SystemPromptHash string       `json:"system_prompt_hash"`
	Source           PromptSource `json:"source"`
}

type PromptSource

type PromptSource string
const (
	PromptSourceSystemPromptOverride PromptSource = "system_prompt_override"
	PromptSourceAgentProfile         PromptSource = "agent_profile"
	PromptSourceEnv                  PromptSource = "env"
	PromptSourceDefaultFloret        PromptSource = "default_floret"
	PromptSourceSessionSnapshot      PromptSource = "session_snapshot"
)

Jump to

Keyboard shortcuts

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