The Go module name has been changed from `carrot_bbs` to `with_you`, which requires all import paths to be updated throughout the codebase and by external consumers. BREAKING CHANGE: Module name changed from carrot_bbs to with_you. All imports and dependencies must be updated from carrot_bbs/* to with_you/*.
28 lines
863 B
Go
28 lines
863 B
Go
package openai
|
|
|
|
import "with_you/internal/config"
|
|
|
|
// Config OpenAI 兼容接口配置
|
|
type Config struct {
|
|
Enabled bool
|
|
BaseURL string
|
|
APIKey string
|
|
ModerationModel string
|
|
ModerationMaxImagesPerRequest int
|
|
RequestTimeoutSeconds int
|
|
StrictModeration bool
|
|
}
|
|
|
|
// ConfigFromAppConfig 从应用配置转换
|
|
func ConfigFromAppConfig(cfg *config.OpenAIConfig) Config {
|
|
return Config{
|
|
Enabled: cfg.Enabled,
|
|
BaseURL: cfg.BaseURL,
|
|
APIKey: cfg.APIKey,
|
|
ModerationModel: cfg.ModerationModel,
|
|
ModerationMaxImagesPerRequest: cfg.ModerationMaxImagesPerRequest,
|
|
RequestTimeoutSeconds: cfg.RequestTimeout,
|
|
StrictModeration: cfg.StrictModeration,
|
|
}
|
|
}
|