Open Nishchit14 opened 2 days ago
Here is the code reference https://github.com/vercel/ai/blob/c5ff26dbb444fe179732d0a96834ca9fb0519002/packages/cohere/src/cohere-embedding-model.ts#L70
It seems like the only float
value is supported for now.
The AI SDK currently only supports float embeddings.
Description
Cohere embeddings are not working other than default
float
.I am trying to create the
binary
embeddings but it generates the invalid response error from the SDK.I am using custom
fetch
This is the error from SDK
This is the console resonse from the cohere
Code example
return createCohere({ apiKey: process.env.EMBEDING_PROVIDER_KEY, fetch: async (url, options) => { const body = JSON.parse(options!.body! as string); console.log(url, "cohere embeded url", options); return fetch(url, { ...options, body: JSON.stringify({ ...body, embedding_types: ["binary"] }), }); }, });
AI provider
@ai-sdk/cohere v.0.0.28
Additional context
No response