configs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 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 Channel added in v0.2.0

type Channel struct {
	WeComAIBot *WeComAIBotOptions `json:"wecomAIBot,omitempty"`
	YuanbaoBot *YuanbaoBotOptions `json:"yuanbaoBot,omitempty"`
}

Channel 信道

type ChannelsConfig added in v0.3.0

type ChannelsConfig struct {
	Enabled  bool      `json:"enabled"`
	Channels []Channel `json:"channels,omitempty"`
}

ChannelsConfig 消息通道配置

type Config

type Config struct {
	// 模型提供商配置
	ModelProviders []models.ModelProvider `json:"modelProviders,omitempty"`
	// 默认模型
	DefaultModels models.Models `json:"defaultModels,omitempty"`
	// 数据提供商配置
	DataProviders agents.DataProviders `json:"dataProviders,omitempty"`
	// 信道
	Channels ChannelsConfig `json:"channels,omitempty"`
	// 语言,可选 en, zh
	Language string `json:"language,omitempty"`
	// 最大上下文窗口
	// 默认 200K
	MaxContextWindow int64 `json:"maxContextWindow,omitempty"`
}

Config 配置

func ConfigFromContext

func ConfigFromContext(ctx context.Context) Config

ConfigFromContext 从上下文获取配置信息

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig 加载配置

type WeComAIBotOptions added in v0.2.0

type WeComAIBotOptions struct {
	BotID  string `json:"botID"`
	Secret string `json:"secret"`
	URL    string `json:"url,omitempty"`
}

WeComAIBotOptions 企业微信智能机器人选项

type YuanbaoBotOptions added in v0.3.0

type YuanbaoBotOptions struct {
	AppID        string `json:"appID"`
	AppSecret    string `json:"appSecret"`
	BaseURL      string `json:"baseURL,omitempty"`
	WebSocketURL string `json:"websocketURL,omitempty"`
}

YuanbaoBotOptions 元宝机器人选项

Jump to

Keyboard shortcuts

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