Skip to content

Conversation

@ShivangiReja
Copy link
Collaborator

@ShivangiReja ShivangiReja commented Aug 26, 2025

Introduces service-tier support for Chat and Responses.

Chat:

  • Added extensible enum ChatServiceTier.
  • Added ServiceTier property to ChatCompletionOptions (request).
  • Added ServiceTier to ChatCompletion and StreamingChatCompletionUpdate (response).

Responses:

  • Added extensible enum ResponseServiceTier.
  • Added ServiceTier property to ResponseCreationOptions(request).
  • Added ServiceTier to OpenAIResponse(response) .

Issue: #592

Comment on lines +22 to +24
@@alternateType(CreateChatCompletionRequest.service_tier, DotNetChatServiceTier);
@@alternateType(CreateChatCompletionResponse.service_tier, DotNetChatServiceTier);
@@alternateType(CreateChatCompletionStreamResponse.service_tier, DotNetChatServiceTier);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious - why did we have to do this versus only renaming InternalServiceTier and making it public?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking about it some more, this is so that we can have the differentiated type name for Chat and Responses. 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the spec, ServiceTier is defined as a common type shared across multiple subclients (like Chat and Responses) but in the .NET SDK, we don’t share types between subclients. Instead, for common types we generate custom wrappers per subclient. That’s why we introduce subclient-specific types, see spec example here:

union DotNetChatServiceTier {
  ServiceTier
}

union DotNetResponseServiceTier {
  ServiceTier
}

This way each subclient gets its own strongly-typed version while still mapping back to the same spec definition.

@ShivangiReja ShivangiReja merged commit 652ff02 into openai:main Aug 27, 2025
1 check 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.

3 participants