cheshire-cat-ai / core

Production ready AI agent framework
https://cheshirecat.ai
GNU General Public License v3.0
2.14k stars 282 forks source link

[BUG] Cohere API requires array of strings for stop sequence #843

Closed elebumm closed 4 weeks ago

elebumm commented 1 month ago

Describe the bug When you insert a Cohere API key, it gives an error when trying to use the LLM saying:

 Retrying langchain_community.llms.cohere.acompletion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised CohereAPIError: invalid type: parameter stop_sequences is of type string but should be of type []Object.

To Reproduce

  1. Insert Cohere API key
  2. Use the LLM
  3. Check console.

Expected behavior A response, instead it gets hungup with a langchain error.

Additional context I believe it's because Cheshire Cat is sending just a string instead of an array of strings.

valentimarco commented 1 month ago

Hi, thanks for address the issue. The error seems related to a deprecated version of the class we use to interact with cohere, and a PR is already open to fix the problem. Sorry for the incontinence but langchain is evolving to fast and we don't XD

valentimarco commented 4 weeks ago

We pushed a new version of the cat -> 1.6.2 and should work just fine