Skip to content

Add support for Chat Completion Service Tier #1023

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 2 commits into from
Jul 8, 2025

Conversation

mathewtinsley
Copy link
Contributor

@mathewtinsley mathewtinsley commented Jun 23, 2025

Describe the change

This adds support for specifying the Service Tier in a chat completion request.

Provide OpenAI documentation link

https://platform.openai.com/docs/api-reference/chat/create#chat-create-service_tier

Describe your solution

  • Added service_tier to the chat completion request and response
  • Added consts for the possible service_tier values, based on the documentation

Tests

  • Manually tested calling the chat completion endpoint with the service_tier to flex.
  • Manually regression tested calling the endpoint without service_tier set.

Additional Context

The service_tier property is needed to use flex and priority processing:

Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.83%. Comparing base (d7dca83) to head (9504bf3).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1023      +/-   ##
==========================================
+ Coverage   85.43%   85.83%   +0.40%     
==========================================
  Files          43       43              
  Lines        2313     2316       +3     
==========================================
+ Hits         1976     1988      +12     
+ Misses        315      305      -10     
- Partials       22       23       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Owner

@sashabaranov sashabaranov left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

@sashabaranov sashabaranov merged commit bd612ce into sashabaranov:master Jul 8, 2025
3 checks 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.

None yet

2 participants