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

@@ -1,6 +1,7 @@
package provider
import (
"errors"
"fmt"
"github.com/alibaba/higress/plugins/wasm-go/extensions/ai-proxy/util"
@@ -20,6 +21,9 @@ type baichuanProviderInitializer struct {
}
func (m *baichuanProviderInitializer) ValidateConfig(config ProviderConfig) error {
if config.apiTokens == nil || len(config.apiTokens) == 0 {
return errors.New("no apiToken found in provider config")
}
return nil
}