Skip to content

Add better structured outputs handling for ChatCompletions #95

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

Merged
merged 19 commits into from
Jul 18, 2025

Conversation

huiwengoh
Copy link
Collaborator

Key Info

Branching off #93 for now to minimize changes / conflict

  • Implementation plan: link
  • Priority:

What changed?

What do you want the reviewer(s) to focus on?


Checklist

  • Did you link the GitHub issue?
  • Did you follow deployment steps or bump the version if needed?
  • Did you add/update tests?
  • What QA did you do?
    • Tested...

@huiwengoh huiwengoh requested a review from jas2600 July 11, 2025 21:46
@@ -5,8 +5,10 @@
It works for any OpenAI LLM model, as well as the many other non-OpenAI LLMs that are also usable via Chat Completions API (Gemini, DeepSeek, Llama, etc).
Copy link
Member

Choose a reason for hiding this comment

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

In VPC, what will be the recommended way to score:

  • tool calls
  • structured outputs

?

Base automatically changed from jwmueller-toolcallschat to main July 14, 2025 21:31
@huiwengoh huiwengoh requested a review from jas2600 July 17, 2025 21:01

await handle_api_key_error_from_resp(res)
await handle_http_bad_request_error_from_resp(res)
handle_rate_limit_error_from_resp(res)
Copy link
Contributor

Choose a reason for hiding this comment

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

this check can be placed above the await res.json() so in some scenarios It avoids an unnecessary attempt to parse the response body if the http status is already rate limit

@huiwengoh huiwengoh merged commit a8c8a2f into main Jul 18, 2025
3 checks passed
@huiwengoh huiwengoh deleted the chatcompletions-structure-outputs branch July 18, 2025 16:19
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.

4 participants