mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 15:30:26 +00:00
fix: fix baidu's embedding api (#398)
* fix:judge baidu embeddings input type * chore: add back update all channels balance * chore: update default configuration for sql connection --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
@@ -150,8 +150,12 @@ func embeddingRequestOpenAI2Baidu(request GeneralOpenAIRequest) *BaiduEmbeddingR
|
||||
switch request.Input.(type) {
|
||||
case string:
|
||||
baiduEmbeddingRequest.Input = []string{request.Input.(string)}
|
||||
case []string:
|
||||
baiduEmbeddingRequest.Input = request.Input.([]string)
|
||||
case []any:
|
||||
for _, item := range request.Input.([]any) {
|
||||
if str, isStr := item.(string); isStr {
|
||||
baiduEmbeddingRequest.Input = append(baiduEmbeddingRequest.Input, str)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &baiduEmbeddingRequest
|
||||
}
|
||||
|
Reference in New Issue
Block a user