setting

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 0 Imported by: 0

README

setting

Minimal configuration stubs for relay providers. In LingRein these are backed by a database; in library mode they return sensible defaults that the consuming application can override.

Key Types

  • GlobalSettings -- global relay settings (e.g. PassThroughRequestEnabled).
  • ModelSetting -- model-specific settings (thinking adapter toggle and budget percentage).
  • GeminiSetting -- Gemini-specific settings (thinking adapter, function response ID handling).

Key Functions

  • GetGlobalSettings / SetGlobalSettings -- access and replace global settings.
  • GetModelSetting -- returns the model settings instance.
  • GetGeminiSettings / GetGeminiVersionSetting -- Gemini settings and API version (defaults to v1beta).
  • ShouldPreserveThinkingSuffix -- defaults to false.
  • IsSyncImageModel -- defaults to false.
  • WithCompactModelVariants / WithCompactModelSuffix -- identity stubs in library mode.

Usage

s := setting.GetGlobalSettings()
s.PassThroughRequestEnabled = true

Documentation

Overview

Package setting provides minimal configuration stubs for relay providers. In LingRein, these are backed by a database-backed settings system. In library mode, they return sensible defaults that can be overridden by the consuming application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGeminiVersionSetting

func GetGeminiVersionSetting(modelName string) string

GetGeminiVersionSetting returns the API version for a Gemini model. Defaults to "v1beta".

func IsSyncImageModel

func IsSyncImageModel(modelName string) bool

IsSyncImageModel reports whether a model supports synchronous image generation. Defaults to false.

func SetGlobalSettings

func SetGlobalSettings(s *GlobalSettings)

SetGlobalSettings replaces the global settings.

func ShouldPreserveThinkingSuffix

func ShouldPreserveThinkingSuffix(modelName string) bool

ShouldPreserveThinkingSuffix reports whether a model's thinking suffix should be preserved. In library mode, defaults to false.

func WithCompactModelSuffix

func WithCompactModelSuffix(suffix string) string

WithCompactModelSuffix returns a model name with a compact suffix. In library mode, returns the input unchanged.

func WithCompactModelVariants

func WithCompactModelVariants(baseModelList []string) []string

WithCompactModelVariants returns the base model list for compact mode. In library mode, returns the input unchanged.

Types

type GeminiSetting

type GeminiSetting struct {
	ThinkingAdapterEnabled                bool
	ThinkingAdapterBudgetTokensPercentage float64
	RemoveFunctionResponseIdEnabled       bool
}

GeminiSetting holds Gemini-specific settings.

func GetGeminiSettings

func GetGeminiSettings() *GeminiSetting

GetGeminiSettings returns the Gemini settings instance.

type GlobalSettings

type GlobalSettings struct {
	PassThroughRequestEnabled bool
}

GlobalSettings holds global relay settings. All fields default to false/empty.

func GetGlobalSettings

func GetGlobalSettings() *GlobalSettings

GetGlobalSettings returns the global settings instance.

type ModelSetting

type ModelSetting struct {
	ThinkingAdapterEnabled                bool
	ThinkingAdapterBudgetTokensPercentage float64
}

ModelSetting holds model-specific settings.

func GetModelSetting

func GetModelSetting() *ModelSetting

GetModelSetting returns the model settings instance.

Jump to

Keyboard shortcuts

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