ai-proxy: support custom openai provider (#1176)

Co-authored-by: Kent Dong <ch3cho@qq.com>
This commit is contained in:
澄潭
2024-08-07 10:33:01 +08:00
committed by GitHub
parent 536a3069a8
commit 0a578c2a04
17 changed files with 110 additions and 38 deletions

View File

@@ -26,6 +26,9 @@ func (m *moonshotProviderInitializer) ValidateConfig(config ProviderConfig) erro
if config.moonshotFileId != "" && config.context != nil {
return errors.New("moonshotFileId and context cannot be configured at the same time")
}
if config.apiTokens == nil || len(config.apiTokens) == 0 {
return errors.New("no apiToken found in provider config")
}
return nil
}