config

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCacheDBPath                = ".hyperlocalise/cache/cache.sqlite"
	DefaultCacheMaxOpen               = 1
	DefaultCacheMaxIdle               = 1
	DefaultCacheMaxLifeSec            = 300
	DefaultCacheL1MaxItems            = 50000
	DefaultCacheL2AutoAcceptThreshold = 0.90
	DefaultCacheRAGTopK               = 5
)

Variables

This section is empty.

Functions

func JSONSchema

func JSONSchema() ([]byte, error)

JSONSchema returns the generated JSON schema for I18NConfig.

Types

type BucketConfig

type BucketConfig struct {
	Files []BucketFileMapping `json:"files" jsonschema:"required"`
}

BucketConfig defines file mappings for a bucket.

type BucketFileMapping

type BucketFileMapping struct {
	From string `json:"from" jsonschema:"required"`
	To   string `json:"to" jsonschema:"required"`
}

BucketFileMapping defines source/target file paths for a bucket.

type CacheConfig added in v1.1.8

type CacheConfig struct {
	Enabled                        bool                 `json:"enabled,omitempty"`
	DBPath                         string               `json:"db_path,omitempty"`
	SQLite                         CacheSQLiteConfig    `json:"sqlite,omitempty"`
	L1                             CacheTierConfig      `json:"l1,omitempty"`
	L2                             CacheTierConfig      `json:"l2,omitempty"`
	RAG                            CacheRetrieverConfig `json:"rag,omitempty"`
	GlossaryTermbaseVersion        string               `json:"glossary_termbase_version,omitempty"`
	RetrievalCorpusSnapshotVersion string               `json:"retrieval_corpus_snapshot_version,omitempty"`
}

CacheConfig configures local cache foundation (L1/L2/RAG wiring + SQLite bootstrap).

type CacheRetrieverConfig added in v1.1.8

type CacheRetrieverConfig struct {
	Enabled bool `json:"enabled,omitempty"`
	TopK    int  `json:"top_k,omitempty"`
}

CacheRetrieverConfig configures optional retrieval augmentation settings.

type CacheSQLiteConfig added in v1.1.8

type CacheSQLiteConfig struct {
	MaxOpenConns    int `json:"max_open_conns,omitempty"`
	MaxIdleConns    int `json:"max_idle_conns,omitempty"`
	ConnMaxLifetime int `json:"conn_max_lifetime_seconds,omitempty"`
}

CacheSQLiteConfig controls sqlite connection pool tuning.

type CacheTierConfig added in v1.1.8

type CacheTierConfig struct {
	Enabled             bool    `json:"enabled,omitempty"`
	MaxItems            int     `json:"max_items,omitempty"`
	AutoAcceptThreshold float64 `json:"auto_accept_threshold,omitempty"`
}

CacheTierConfig configures a cache tier toggle and capacity hints.

type GroupConfig

type GroupConfig struct {
	Targets []string `json:"targets,omitempty"`
	Buckets []string `json:"buckets,omitempty"`
}

GroupConfig selects locales and buckets.

type I18NConfig

type I18NConfig struct {
	Locales LocaleConfig            `json:"locales" jsonschema:"required"`
	Buckets map[string]BucketConfig `json:"buckets" jsonschema:"required"`
	Groups  map[string]GroupConfig  `json:"groups" jsonschema:"required"`
	LLM     LLMConfig               `json:"llm" jsonschema:"required"`
	Storage *StorageConfig          `json:"storage,omitempty"`
	Cache   CacheConfig             `json:"cache,omitempty"`
}

I18NConfig defines the i18n configuration file structure.

func Load

func Load(path string) (*I18NConfig, error)

Load parses and validates i18n configuration from path. When path is empty, it defaults to i18n.jsonc in the current working directory.

func (I18NConfig) Validate

func (c I18NConfig) Validate() error

Validate validates all cross-field i18n configuration semantics.

type LLMConfig

type LLMConfig struct {
	Profiles      map[string]LLMProfile    `json:"profiles" jsonschema:"required"`
	ContextMemory *LLMContextMemoryProfile `json:"context_memory,omitempty"`
	Rules         []LLMRule                `json:"rules,omitempty"`
}

LLMConfig defines model defaults, locale groups, and override rules.

type LLMContextMemoryProfile added in v1.1.8

type LLMContextMemoryProfile struct {
	Provider string `json:"provider" jsonschema:"required"`
	Model    string `json:"model" jsonschema:"required"`
}

LLMContextMemoryProfile configures provider/model for context memory building.

type LLMProfile

type LLMProfile struct {
	Provider     string `json:"provider" jsonschema:"required"`
	Model        string `json:"model" jsonschema:"required"`
	Prompt       string `json:"prompt,omitempty"`
	SystemPrompt string `json:"system_prompt,omitempty"`
	UserPrompt   string `json:"user_prompt,omitempty"`
}

LLMProfile contains provider/model prompt configuration.

type LLMRule

type LLMRule struct {
	Priority int    `json:"priority" jsonschema:"required"`
	Group    string `json:"group" jsonschema:"required"`
	Profile  string `json:"profile" jsonschema:"required"`
}

LLMRule applies a profile for a specific group.

type LocaleConfig

type LocaleConfig struct {
	Source    string              `json:"source" jsonschema:"required"`
	Targets   []string            `json:"targets" jsonschema:"required"`
	Fallbacks map[string][]string `json:"fallbacks,omitempty"`
}

LocaleConfig configures source/target locales and fallback hierarchy.

type StorageConfig

type StorageConfig struct {
	Adapter string          `json:"adapter" jsonschema:"required"`
	Config  json.RawMessage `json:"config,omitempty"`
}

StorageConfig configures remote storage adapter sync settings.

Jump to

Keyboard shortcuts

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