shared

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHTTPClient

func DefaultHTTPClient() *http.Client

DefaultHTTPClient returns a hardened HTTP client shared by commands that need to communicate with AI providers.

Types

type ModelEndpoint

type ModelEndpoint struct {
	APIKey   string
	BaseURL  string
	Provider string
}

ModelEndpoint describes the credentials and endpoint overrides for a specific model class.

type RuntimeContext

type RuntimeContext struct {
	Provider         string
	BaseURL          string
	APIKey           string
	LightModel       string
	HeavyModel       string
	Fallback         string
	LightEndpoint    ModelEndpoint
	HeavyEndpoint    ModelEndpoint
	FallbackEndpoint ModelEndpoint
	HTTPClient       *http.Client
	AnalysisTimeout  time.Duration
	WriterTimeout    time.Duration
}

RuntimeContext exposes sanitized configuration and shared dependencies that can be reused across commands without reaching into unrelated domains directly.

func BuildRuntimeContext

func BuildRuntimeContext() (*RuntimeContext, error)

BuildRuntimeContext constructs a RuntimeContext from viper configuration and returns actionable pointers commands can share without duplicating sensitive logic.

func (*RuntimeContext) RedactedCopy

func (rc *RuntimeContext) RedactedCopy() RuntimeContext

RedactedCopy provides a safe snapshot that can be logged or passed to prompts without leaking the API key.

Jump to

Keyboard shortcuts

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