-
Notifications
You must be signed in to change notification settings - Fork 507
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
GROQ Provider: finish_reason returned as integer causes incompatibility with go-openai client #785
Comments
@elliot14A we consciously chose to not transform the values of the fields to avoid loss in context. We attempted doing this before, here's the relevant discussion: |
@narengogi so what would a possible work around for my case then ? |
@elliot14A You could modify the response type of openai client package, or define your own types while using Portkey HTTP endpoint (https://api.portkey.ai/v1) for making the requests |
I just crossed checked the groq api
the |
oh, this is a bug then, I'll prioritize fixing this, thanks for the report @elliot14A! |
@narengogi thanks for the prompt response. Do you have an ETA on when the fix will be implemented? |
@narengogi any update ? |
raised PR @elliot14A |
What Happened?
When using the GROQ provider through Portkey API with go-openai client, the streaming response fails due to a type mismatch. GROQ returns the finish_reason field as an integer (0), but the go-openai client expects it to be a string type ("stop"). This causes the following error:
Example GROQ response showing the integer finish_reason:
sending the finish_reason as integer might cause issues with other clients/libraries as well not just go openai client.
client library i used:
github.com/sashabaranov/go-openai
version:v1.36.0
Would you like me to submit a PR to fix this issue?
What Should Have Happened?
The GROQ provider should have returned the finish_reason as a string value in the streaming response, maintaining compatibility with the go-openai client's expected data structure. The response should have looked like this:
Relevant Code Snippet
GROQ Request:
OPENAI Request:
Your Twitter/LinkedIn
No response
The text was updated successfully, but these errors were encountered: