config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindEnvVars

func BindEnvVars()

BindEnvVars maps environment variables to config keys

func BindFlags

func BindFlags(cmd *cobra.Command)

BindFlags registers CLI flags and maps env vars on a persistent flag set

Types

type Config

type Config struct {
	Provider        string `mapstructure:"provider"`
	OpenAPIPath     string `mapstructure:"openapi-path"`
	GCPProject      string `mapstructure:"gcp-project"`
	GCPLocation     string `mapstructure:"gcp-location"`
	Model           string `mapstructure:"model"`
	URL             string `mapstructure:"url"`
	APIKey          string `mapstructure:"api-key"`
	StrictSchema    bool   `mapstructure:"strict-schema"`
	ListenAddr      string `mapstructure:"listen-addr"`
	SystemPrefix    string `mapstructure:"base-system-prefix"`
	PromptFormat    string `mapstructure:"prompt-format"`
	MaxRequestBytes int64  `mapstructure:"max-request-bytes"`
	TimeoutSeconds  int    `mapstructure:"timeout-seconds"`
	SchemaProfile   string `mapstructure:"schema-profile"`
	Insecure        bool   `mapstructure:"insecure"`
	Mode            Mode   `mapstructure:"mode"`
}

Config holds all application configuration

func Load

func Load() (*Config, error)

Load loads the config from viper

func (*Config) ResolvedSchemaProfile

func (c *Config) ResolvedSchemaProfile() jsp.ProfileID

ResolvedSchemaProfile returns the effective schema profile ID. If SchemaProfile is set it is used as the override; otherwise the default profile is selected based on the provider: OPENAI_202602 for openai, GEMINI_202602 for gemini.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks that required fields are present and provider-specific rules are met

type Mode

type Mode string

Mode controls how model responses are generated.

const (
	ModeSinglePass Mode = "single-pass"
	ModeTwoPass    Mode = "two-pass"
)

Jump to

Keyboard shortcuts

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