Using "cohere-ai": "^5.0.2" in NodeJS, I'm getting an unexpected response from the classify endpoint
netpoe opened this issue · 2 comments
netpoe commented
Using "cohere-ai": "^5.0.2"
in NodeJS, I'm getting an unexpected response from the classify
endpoint:
{
statusCode: 404,
body: {
message: "could not find preset by the ID of 60a0705a-5231-4d4a-b62f-...",
},
}
I've tried several combinations (see attachments) to send the data by specifying a model, but I get typescript errors:
error TS2345: Argument of type '{ model: string; inputs: string[]; }' is not assignable to parameter of type 'classifyRequest'.
Property 'preset' is missing in type '{ model: string; inputs: string[]; }' but required in type 'classifyWithPresetRequest'.
This is the data being sent:
{
model: "60a0705a-5231-4d4a-b62f-...",
inputs: [
"crear wallet mxn",
],
preset: "60a0705a-5231-4d4a-b62f-...",
}
By testing in https://docs.cohere.ai/reference/classify, I do get the expected results with almost the same args and the API Call even excludes preset
.
netpoe commented
I did a hack:
const response = await cohere.client.classify({
model: "60a0705a-5231-4d4a-b62f-8be55def74a5-ft",
inputs: [input],
});
And was able to get a 200 by extending the model:
interface classifyWithModelRequest extends classifyBaseRequest {
}
export type classifyRequest =
| classifyWithInputsRequest
| classifyWithPresetRequest
| classifyWithModelRequest;
dsinghvi commented
@netpoe The updated ClassifyRequest now has an optional preset!