Documentation
¶
Index ¶
- func ConfigPathFromContext(ctx context.Context) string
- func ContextWithConfig(parent context.Context, config Config, path string) context.Context
- func SaveConfig(path string, cfg Config) error
- func SaveDefaultModels(path string, defaultModels models.Models) error
- type Channel
- type ChannelsConfig
- type Config
- type WeComAIBotOptions
- type YuanbaoBotOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPathFromContext ¶
ConfigPathFromContext 从上下文获取配置文件路径
func ContextWithConfig ¶
ContextWithConfig 创建携带配置信息的上下文
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 ¶
ConfigFromContext 从上下文获取配置信息
type WeComAIBotOptions ¶ added in v0.2.0
type WeComAIBotOptions struct {
BotID string `json:"botID"`
Secret string `json:"secret"`
URL string `json:"url,omitempty"`
}
WeComAIBotOptions 企业微信智能机器人选项
Click to show internal directories.
Click to hide internal directories.