-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
OCI Generative AI tool calling bug fix #26910
base: master
Are you sure you want to change the base?
OCI Generative AI tool calling bug fix #26910
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the error? could you add a unit test that triggers the case you're reporting?
if "finishedReason" in event_data or "toolCalls" in event_data: | ||
return "" | ||
else: | ||
return event_data["text"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if "finishedReason" in event_data or "toolCalls" in event_data: | |
return "" | |
else: | |
return event_data["text"] | |
return event_data.get("text") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@efriis It is actually not a key error. It is the mechanism of our API. When finishedReason and toolCalls exists in the response, "text" field will output all the previous content generated and combine them together. This will make the streaming result to be duplicated two to three times.
PR title:
"community: OCI Generative AI tool calling bug fix
PR message:
Add tests and docs: NA
Lint and test: make format, make lint and make test we run successfully