mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 05:39:05 +08:00
fix: voyage ai can't be used on text embedding (#6950)
This commit is contained in:
parent
c38a6cdfbf
commit
7887f4867d
@ -1262,7 +1262,8 @@ export default class OpenAIProvider extends BaseOpenAIProvider {
|
|||||||
const data = await this.sdk.embeddings.create({
|
const data = await this.sdk.embeddings.create({
|
||||||
model: model.id,
|
model: model.id,
|
||||||
input: model?.provider === 'baidu-cloud' ? ['hi'] : 'hi',
|
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
|
return data.data[0].embedding.length
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user