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

Update parsing async openai response #167

Merged
merged 11 commits into from
May 29, 2024
Merged

Conversation

kxtran
Copy link
Collaborator

@kxtran kxtran commented May 29, 2024

No description provided.

@kxtran kxtran force-pushed the kt/update-openai-parsing-response branch from 582c37d to a187093 Compare May 29, 2024 07:51
@kxtran kxtran requested a review from wenzhe-log10 May 29, 2024 08:05
@kxtran kxtran marked this pull request as ready for review May 29, 2024 08:05
idx = tc[0].get("index")
self.tool_calls[idx]["function"]["arguments"] += tc[0]["function"]["arguments"]

if "choices" in r_json and r_json["choices"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r_json.get("choices", {}) and get() generally is a bit more graceful when the key isn't available. Could make the rest of the code more robust/bit more concise

Copy link
Collaborator

@wenzhe-log10 wenzhe-log10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@kxtran kxtran merged commit adabac7 into main May 29, 2024
2 checks passed
@kxtran kxtran deleted the kt/update-openai-parsing-response branch May 29, 2024 17:31
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