We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cohere embeddings are not working other than default float.
float
I am trying to create the binary embeddings but it generates the invalid response error from the SDK.
binary
I am using custom fetch
fetch
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"] }), }); }, });
This is the error from SDK
Error message: [ { "code": "invalid_type", "expected": "array", "received": "undefined", "path": [ "embeddings", "float" ], "message": "Required" } ]
This is the console resonse from the cohere
{ "id":"7dcc3ce4-ee3c-49f6-8fe1-fb5d59d78954", "texts":["Hello Word!"], "embeddings": { "binary":[[112,-18,124,48,83,87,-50,48,124,15,-15,-76,33,-61,-120,-90,90,-75,-69,25,2,-96,109,84,-5,62,-44,-69,-96,-16,124,22,34,-102,-11,117,-123,-58,108,3,-122,67,108,99,-30,7,-19,-115,107,119,9,80,-64,110,1,-3,-126,82,-99,-75,-17,50,15,-68,-50,-51,-64,127,5,-78,-75,-67,54,-70,127,-122,126,-9,-32,0,-96,-31,80,-37,112,-56,29,-108,39,29,-32,-40,-82,-45,76,-58,-5,-14,124,26,19,-48,84,108,47,45,-10,-6,92,57,33,-7,18,-69,92,-47,16,8,90,27,-10,-47,123,104,-69,-110,-56,28]] }, "meta":{"api_version":{"version":"2"}, "billed_units":{"input_tokens":3}}, "response_type":"embeddings_by_type" },
@ai-sdk/cohere v.0.0.28
No response
The text was updated successfully, but these errors were encountered:
Here is the code reference
ai/packages/cohere/src/cohere-embedding-model.ts
Line 70 in c5ff26d
It seems like the only float value is supported for now.
Sorry, something went wrong.
The AI SDK currently only supports float embeddings.
#3654
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: