configs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPathFromContext

func ConfigPathFromContext(ctx context.Context) string

ConfigPathFromContext 从上下文获取配置文件路径

func ContextWithConfig

func ContextWithConfig(parent context.Context, config Config, path string) context.Context

ContextWithConfig 创建携带配置信息的上下文

func SaveConfig

func SaveConfig(path string, cfg Config) error

SaveConfig 保存配置

func SaveDefaultModels

func SaveDefaultModels(path string, defaultModels models.Models) error

SaveDefaultModels 仅保存默认模型配置

Types

type Config

type Config struct {
	// 模型提供商配置
	ModelProviders []models.ModelProvider `json:"modelProviders,omitempty"`
	// 默认模型
	DefaultModels models.Models `json:"defaultModels,omitempty"`
	// 数据提供商配置
	DataProviders agents.DataProviders `json:"dataProviders,omitempty"`
	// 语言,可选 en, zh
	Language string `json:"language,omitempty"`
}

Config 配置

func ConfigFromContext

func ConfigFromContext(ctx context.Context) Config

ConfigFromContext 从上下文获取配置信息

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig 加载配置

Jump to

Keyboard shortcuts

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