cohere-ai / cohere-typescript

The Cohere TypeScript SDK
https://docs.cohere.ai
MIT License
127 stars 18 forks source link

`chat` method crash with `searchQueriesOnly=true` parameter #103

Closed exentrich closed 1 year ago

exentrich commented 1 year ago
await cohere.chat({
    message: 'how to create a masonry layout in css?',
    searchQueriesOnly: true
})

Crash with error:

error: response: Missing required key "text"; response: Missing required key "generation_id"
    at new ParseError (node_modules/cohere-ai/core/schemas/builders/schema-utils/ParseError.js:7:8)

It seems like an internal library error. The chat() method expects a text and generation_id in the response, but these keys are missing when using the searchQueriesOnly parameter.

billytrend-cohere commented 1 year ago

Hey @exentrich, we currently do client side response validation which I think we will turn off because it causes issues like you are seeing. I'll try release a new sdk version today :)

exentrich commented 1 year ago

Thank you so much! Cohere is currently the most user-friendly solution. You don't need a PhD to start creating an AI-powered search :) Looking forward for the update!

billytrend-cohere commented 1 year ago

This is so great to hear! also your issue should be fixed with 7.4.0. Let us know if you have any further problems