mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
fix: voyage ai can't be used on text embedding (#6950)
This commit is contained in:
parent
021428a88e
commit
f400015a1e
@ -1262,7 +1262,8 @@ export default class OpenAIProvider extends BaseOpenAIProvider {
|
||||
const data = await this.sdk.embeddings.create({
|
||||
model: model.id,
|
||||
input: model?.provider === 'baidu-cloud' ? ['hi'] : 'hi',
|
||||
encoding_format: 'float'
|
||||
// @ts-ignore voyage api need null
|
||||
encoding_format: model?.provider === 'voyageai' ? null : 'float'
|
||||
})
|
||||
return data.data[0].embedding.length
|
||||
} catch (e) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user