-
Notifications
You must be signed in to change notification settings - Fork 343
Add service tier support to Chat and Responses APIs #628
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
Conversation
…hreja/AddServiceTier
| @@alternateType(CreateChatCompletionRequest.service_tier, DotNetChatServiceTier); | ||
| @@alternateType(CreateChatCompletionResponse.service_tier, DotNetChatServiceTier); | ||
| @@alternateType(CreateChatCompletionStreamResponse.service_tier, DotNetChatServiceTier); |
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.
Just curious - why did we have to do this versus only renaming InternalServiceTier and making it public?
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.
Thinking about it some more, this is so that we can have the differentiated type name for Chat and Responses. 😄
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.
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.
Introduces service-tier support for Chat and Responses.
Chat:
ChatServiceTier.ServiceTierproperty to ChatCompletionOptions (request).ServiceTierto ChatCompletion and StreamingChatCompletionUpdate (response).Responses:
ResponseServiceTier.ServiceTierproperty to ResponseCreationOptions(request).ServiceTierto OpenAIResponse(response) .Issue: #592