intelligentnode / Intelli

Create chatbot and AI agent workflows with unified access.
https://docs.intellinode.ai
Apache License 2.0
37 stars 5 forks source link

Add cohere as provider to the chatbot #47

Open intelligentnode opened 7 months ago

intelligentnode commented 7 months ago

Update the chatbot to add cohere as provider, then update the chat and stream function to call the wrapper.

expected changes:

basilmusa commented 7 months ago

@intelligentnode where can I get the structure of the json response for cohere responses? I'm trying to implement Chatbot._parse_cohere_responses(results) method but need the structure of the response.

intelligentnode commented 7 months ago

@basilmusa kindly check the chatbot response structure below:

you can access the none-stream model text response as follow: results.text

{
  "text": "string",
  "generation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "citations": [
    {
      "start": 0,
      "end": 0,
      "text": "string",
      "document_ids": [
        "string"
      ]
    }
  ],
  "documents": [
    {
      "id": "string",
      "additionalProp": "string"
    }
  ],
  "search_queries": [
    {
      "text": "string",
      "generation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
    }
  ],
  "search_results": [
    {
      "search_query": {
        "text": "string",
        "generation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      },
      "connector": {
        "id": "string"
      },
      "document_ids": [
        "string"
      ]
    }
  ]
}