-
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,7 @@ using Azure.ClientGenerator.Core; | |
| @@visibility(ChatCompletionStreamResponseDelta.tool_calls, Lifecycle.Read); | ||
|
|
||
| @@clientName(Chat.createChatCompletion, "CompleteChat"); | ||
|
|
||
| @@alternateType(CreateChatCompletionRequest.service_tier, DotNetChatServiceTier); | ||
| @@alternateType(CreateChatCompletionResponse.service_tier, DotNetChatServiceTier); | ||
| @@alternateType(CreateChatCompletionStreamResponse.service_tier, DotNetChatServiceTier); | ||
|
Comment on lines
+22
to
+24
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious - why did we have to do this versus only renaming
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. 😄
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the spec, 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. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import "../base/typespec/responses/main.tsp"; | ||
| import "@azure-tools/typespec-client-generator-core"; | ||
|
|
||
| using OpenAI; | ||
| using Azure.ClientGenerator.Core; | ||
|
|
||
| @@alternateType(CreateResponse.service_tier, DotNetResponseServiceTier); | ||
| @@alternateType(Response.service_tier, DotNetResponseServiceTier); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace OpenAI.Chat; | ||
|
|
||
| // CUSTOM: Renamed. | ||
| [CodeGenType("DotNetChatServiceTier")] | ||
| public readonly partial struct ChatServiceTier | ||
| { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace OpenAI.Responses; | ||
|
|
||
| // CUSTOM: Renamed. | ||
| [CodeGenType("DotNetResponseServiceTier")] | ||
| public readonly partial struct ResponseServiceTier | ||
| { | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.