Skip to content
New issue

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

Fix cohere message param transform #562

Merged
merged 2 commits into from
Aug 31, 2024

Conversation

narengogi
Copy link
Contributor

@narengogi narengogi commented Aug 30, 2024

#563

Verified by making calls to the llm

@b4s36t4
Copy link
Contributor

b4s36t4 commented Aug 31, 2024

curl --request POST \
  --url <gateway_url>/v1/chat/completions \
  --header 'authorization: skhXH9Bzk62KcSKmioNF4ueyCRq84O094rv5kN5l' \
  --header 'content-type: application/json' \
  --header 'x-portkey-provider: cohere' \
  --data '{
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    },
    {
      "role": "assistant",
      "content": "Hi there! How can I help you today?\n\nIf you would like, you can skip the small talk and get right to what you need assistance with. I'\''m a chatbot trained to be helpful, polite, and inclusive. \n\nHow can I help you today?"
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Tell me a story"
        },
        {
          "type": "text",
          "text": "about cinderella"
        }
      ]
    }
  ],
  "max_tokens": 10,
  "stream": false
}'

Tested and working as expected.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Aug 31, 2024

@narengogi, for the cohere complete response transformer we have a constant finish_reason which is wrong, can you please also fix that to use response.finish_reason? Thanks!

@VisargD VisargD merged commit f94419b into Portkey-AI:main Aug 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants