mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-17 00:23:56 +00:00
* feat:支持阿里的 embedding 模型 * fix: add to model list --------- Co-authored-by: JustSong <songquanpeng@foxmail.com> Co-authored-by: JustSong <39998050+songquanpeng@users.noreply.github.com>
This commit is contained in:
@@ -144,20 +144,9 @@ func streamResponseBaidu2OpenAI(baiduResponse *BaiduChatStreamResponse) *ChatCom
|
||||
}
|
||||
|
||||
func embeddingRequestOpenAI2Baidu(request GeneralOpenAIRequest) *BaiduEmbeddingRequest {
|
||||
baiduEmbeddingRequest := BaiduEmbeddingRequest{
|
||||
Input: nil,
|
||||
return &BaiduEmbeddingRequest{
|
||||
Input: request.ParseInput(),
|
||||
}
|
||||
switch request.Input.(type) {
|
||||
case string:
|
||||
baiduEmbeddingRequest.Input = []string{request.Input.(string)}
|
||||
case []any:
|
||||
for _, item := range request.Input.([]any) {
|
||||
if str, ok := item.(string); ok {
|
||||
baiduEmbeddingRequest.Input = append(baiduEmbeddingRequest.Input, str)
|
||||
}
|
||||
}
|
||||
}
|
||||
return &baiduEmbeddingRequest
|
||||
}
|
||||
|
||||
func embeddingResponseBaidu2OpenAI(response *BaiduEmbeddingResponse) *OpenAIEmbeddingResponse {
|
||||
|
Reference in New Issue
Block a user