Skip to content

Commit d66058c

Browse files
committed
Add dynamicModel decorator
1 parent 6bb8493 commit d66058c

File tree

581 files changed

+14108
-7331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

581 files changed

+14108
-7331
lines changed

specification/client/chat.client.tsp

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import "../base/typespec/chat/main.tsp";
22
import "@azure-tools/typespec-client-generator-core";
3+
import "@typespec/http-client-csharp";
34

45
using OpenAI;
56
using Azure.ClientGenerator.Core;
7+
using TypeSpec.HttpClient.CSharp;
68

79
@@access(ChatCompletionFunctionChoice, Access.public);
810
@@usage(ChatCompletionFunctionChoice, Usage.input);
@@ -22,3 +24,55 @@ using Azure.ClientGenerator.Core;
2224
@@alternateType(CreateChatCompletionRequest.service_tier, DotNetChatServiceTier);
2325
@@alternateType(CreateChatCompletionResponse.service_tier, DotNetChatServiceTier);
2426
@@alternateType(CreateChatCompletionStreamResponse.service_tier, DotNetChatServiceTier);
27+
28+
// ------------ JsonPatch ------------
29+
30+
// models.tsp models
31+
@@dynamicModel(CreateChatCompletionRequest);
32+
@@dynamicModel(CreateChatCompletionResponse);
33+
@@dynamicModel(ChatCompletionTool);
34+
@@dynamicModel(ChatCompletionNamedToolChoice);
35+
@@dynamicModel(ChatCompletionRequestMessageContentPartText);
36+
@@dynamicModel(ChatCompletionRequestMessageContentPartImage);
37+
@@dynamicModel(ChatCompletionRequestMessageContentPartRefusal);
38+
@@dynamicModel(ChatCompletionRequestMessageContentPartFile);
39+
@@dynamicModel(ChatCompletionMessageToolCall);
40+
@@dynamicModel(ChatCompletionRequestMessage);
41+
@@dynamicModel(ChatCompletionRequestMessageContentPartAudio);
42+
@@dynamicModel(ChatCompletionRequestSystemMessage);
43+
@@dynamicModel(ChatCompletionRequestDeveloperMessage);
44+
@@dynamicModel(ChatCompletionRequestUserMessage);
45+
@@dynamicModel(ChatCompletionRequestAssistantMessage);
46+
@@dynamicModel(ChatCompletionRequestToolMessage);
47+
@@dynamicModel(ChatCompletionRequestFunctionMessage);
48+
@@dynamicModel(ChatCompletionMessageToolCalls);
49+
@@dynamicModel(ChatCompletionModalities);
50+
@@dynamicModel(ChatCompletionResponseMessage);
51+
@@dynamicModel(ChatCompletionTokenLogprob);
52+
@@dynamicModel(ChatCompletionFunctionCallOption);
53+
@@dynamicModel(ChatCompletionFunctions);
54+
@@dynamicModel(ChatCompletionStreamResponseDelta);
55+
@@dynamicModel(ChatCompletionMessageToolCallChunk);
56+
@@dynamicModel(CreateChatCompletionStreamResponse);
57+
@@dynamicModel(ChatOutputPredictionContent);
58+
@@dynamicModel(ChatCompletionDeleted);
59+
@@dynamicModel(ChatCompletionList);
60+
@@dynamicModel(ChatCompletionMessageList);
61+
// custom.tsp models
62+
@@dynamicModel(ChatOutputPrediction);
63+
@@dynamicModel(ChatCompletionFunctionChoice);
64+
@@dynamicModel(ChatCompletionToolChoice);
65+
@@dynamicModel(ChatCompletionRequestMessageContentPart);
66+
@@dynamicModel(ChatCompletionMessageAudioChunk);
67+
// client/models/chat.models.tsp models
68+
@@dynamicModel(ChatCompletionCollectionOrder);
69+
@@dynamicModel(ChatCompletionCollectionOptions);
70+
@@dynamicModel(ChatCompletionMessageCollectionOrder);
71+
@@dynamicModel(ChatCompletionMessageCollectionOptions);
72+
// client/models/common.models.tsp models
73+
@@dynamicModel(DotNetChatResponseFormat);
74+
@@dynamicModel(DotNetChatResponseFormatText);
75+
@@dynamicModel(DotNetChatResponseFormatJsonObject);
76+
@@dynamicModel(DotNetChatResponseFormatJsonSchema);
77+
@@dynamicModel(DotNetChatVoiceIds);
78+
@@dynamicModel(DotNetChatServiceTier);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import "../base/typespec/embeddings/main.tsp";
22
import "@azure-tools/typespec-client-generator-core";
3+
import "@typespec/http-client-csharp";
34

45
using OpenAI;
56
using Azure.ClientGenerator.Core;
7+
using TypeSpec.HttpClient.CSharp;
68

79
@@clientName(Embeddings.createEmbedding, "GenerateEmbeddings");
10+
11+
// ------------ JsonPatch ------------
12+
13+
// models.tsp models
14+
@@dynamicModel(CreateEmbeddingRequest);
15+
@@dynamicModel(CreateEmbeddingResponse);
16+
@@dynamicModel(Embedding);

specification/client/responses.client.tsp

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import "../base/typespec/responses/main.tsp";
22
import "@azure-tools/typespec-client-generator-core";
3+
import "@typespec/http-client-csharp";
34

45
using OpenAI;
56
using Azure.ClientGenerator.Core;
7+
using TypeSpec.HttpClient.CSharp;
68

79
@@alternateType(CreateResponse.service_tier, DotNetResponseServiceTier);
810
@@alternateType(Response.service_tier, DotNetResponseServiceTier);
@@ -81,4 +83,207 @@ using Azure.ClientGenerator.Core;
8183

8284
@@alternateType(ResponseMCPCallArgumentsDeltaEvent.delta, unknown);
8385

84-
@@clientName(ResponseImageGenCallPartialImageEvent.partial_image_b64, "PartialImageBytes");
86+
@@clientName(ResponseImageGenCallPartialImageEvent.partial_image_b64, "PartialImageBytes");
87+
88+
// ------------ JsonPatch ------------
89+
90+
// models.tsp
91+
@@dynamicModel(CreateResponse);
92+
@@dynamicModel(Response);
93+
@@dynamicModel(ResponseProperties);
94+
@@dynamicModel(ItemParam);
95+
@@dynamicModel(Tool);
96+
@@dynamicModel(ToolChoiceObject);
97+
@@dynamicModel(ToolChoiceObjectFileSearch);
98+
@@dynamicModel(ToolChoiceObjectComputer);
99+
@@dynamicModel(ToolChoiceObjectWebSearch);
100+
@@dynamicModel(ToolChoiceObjectImageGen);
101+
@@dynamicModel(ToolChoiceObjectCodeInterpreter);
102+
@@dynamicModel(ToolChoiceObjectMCP);
103+
@@dynamicModel(ToolChoiceObjectFunction);
104+
@@dynamicModel(FunctionTool);
105+
@@dynamicModel(FileSearchTool);
106+
@@dynamicModel(ComputerUsePreviewTool);
107+
@@dynamicModel(WebSearchPreviewTool);
108+
@@dynamicModel(Location);
109+
@@dynamicModel(ApproximateLocation);
110+
@@dynamicModel(ComputerCallSafetyCheckParam);
111+
@@dynamicModel(ComputerToolCallSafetyCheck);
112+
@@dynamicModel(ComputerActionClick);
113+
@@dynamicModel(ComputerAction);
114+
@@dynamicModel(ComputerToolCallOutputItemOutput);
115+
@@dynamicModel(ComputerToolCallOutputItemOutputComputerScreenshot);
116+
@@dynamicModel(ComputerActionDoubleClick);
117+
@@dynamicModel(ComputerActionDrag);
118+
@@dynamicModel(ComputerActionMove);
119+
@@dynamicModel(ComputerActionScreenshot);
120+
@@dynamicModel(ComputerActionScroll);
121+
@@dynamicModel(ComputerActionTypeKeys);
122+
@@dynamicModel(ComputerActionWait);
123+
@@dynamicModel(ComputerActionKeyPress);
124+
@@dynamicModel(Coordinate);
125+
@@dynamicModel(Reasoning);
126+
@@dynamicModel(ResponseTextFormatConfiguration);
127+
@@dynamicModel(ResponseTextFormatConfigurationText);
128+
@@dynamicModel(ResponseTextFormatConfigurationJsonObject);
129+
@@dynamicModel(ResponseTextFormatConfigurationJsonSchema);
130+
@@dynamicModel(ItemContent);
131+
@@dynamicModel(ItemContentInputAudio);
132+
@@dynamicModel(InputMessageContentList);
133+
@@dynamicModel(ItemContentOutputAudio);
134+
@@dynamicModel(ItemContentRefusal);
135+
@@dynamicModel(Annotation);
136+
@@dynamicModel(AnnotationFileCitation);
137+
@@dynamicModel(AnnotationUrlCitation);
138+
@@dynamicModel(ContainerFileCitationBody);
139+
@@dynamicModel(AnnotationFilePath);
140+
@@dynamicModel(ItemContentInputText);
141+
@@dynamicModel(ItemContentInputImage);
142+
@@dynamicModel(ItemContentInputFile);
143+
@@dynamicModel(RankingOptions);
144+
@@dynamicModel(ItemContentOutputText);
145+
@@dynamicModel(ResponseUsage);
146+
@@dynamicModel(ResponseError);
147+
@@dynamicModel(ResponseItemList);
148+
@@dynamicModel(ResponseStreamEvent);
149+
@@dynamicModel(ResponseCompletedEvent);
150+
@@dynamicModel(ResponseContentPartAddedEvent);
151+
@@dynamicModel(ResponseContentPartDoneEvent);
152+
@@dynamicModel(ResponseCreatedEvent);
153+
@@dynamicModel(ResponseErrorEvent);
154+
@@dynamicModel(ResponseFileSearchCallCompletedEvent);
155+
@@dynamicModel(ResponseFileSearchCallInProgressEvent);
156+
@@dynamicModel(ResponseFileSearchCallSearchingEvent);
157+
@@dynamicModel(ResponseFunctionCallArgumentsDeltaEvent);
158+
@@dynamicModel(ResponseFunctionCallArgumentsDoneEvent);
159+
@@dynamicModel(ResponseInProgressEvent);
160+
@@dynamicModel(ResponseFailedEvent);
161+
@@dynamicModel(ResponseIncompleteEvent);
162+
@@dynamicModel(ResponseOutputItemAddedEvent);
163+
@@dynamicModel(ResponseOutputItemDoneEvent);
164+
@@dynamicModel(ResponseRefusalDeltaEvent);
165+
@@dynamicModel(ResponseRefusalDoneEvent);
166+
@@dynamicModel(ResponseTextDeltaEvent);
167+
@@dynamicModel(ResponseTextDoneEvent);
168+
@@dynamicModel(ResponseReasoningSummaryPartAddedEvent);
169+
@@dynamicModel(ResponseReasoningSummaryPartDoneEvent);
170+
@@dynamicModel(ResponseReasoningSummaryTextDeltaEvent);
171+
@@dynamicModel(ResponseReasoningSummaryTextDoneEvent);
172+
@@dynamicModel(ResponseWebSearchCallCompletedEvent);
173+
@@dynamicModel(ResponseWebSearchCallInProgressEvent);
174+
@@dynamicModel(ResponseWebSearchCallSearchingEvent);
175+
@@dynamicModel(ItemResource);
176+
@@dynamicModel(CodeInterpreterTool);
177+
@@dynamicModel(CodeInterpreterToolAuto);
178+
@@dynamicModel(ImageGenTool);
179+
@@dynamicModel(LocalShellExecAction);
180+
@@dynamicModel(LocalShellTool);
181+
@@dynamicModel(MCPListToolsTool);
182+
@@dynamicModel(MCPTool);
183+
@@dynamicModel(MCPToolFilter);
184+
@@dynamicModel(ResponseImageGenCallCompletedEvent);
185+
@@dynamicModel(ResponseImageGenCallGeneratingEvent);
186+
@@dynamicModel(ResponseImageGenCallInProgressEvent);
187+
@@dynamicModel(ResponseImageGenCallPartialImageEvent);
188+
@@dynamicModel(ResponseMCPCallArgumentsDeltaEvent);
189+
@@dynamicModel(ResponseMCPCallArgumentsDoneEvent);
190+
@@dynamicModel(ResponseMCPCallCompletedEvent);
191+
@@dynamicModel(ResponseMCPCallFailedEvent);
192+
@@dynamicModel(ResponseMCPCallInProgressEvent);
193+
@@dynamicModel(ResponseMCPListToolsCompletedEvent);
194+
@@dynamicModel(ResponseMCPListToolsFailedEvent);
195+
@@dynamicModel(ResponseMCPListToolsInProgressEvent);
196+
@@dynamicModel(ResponseOutputTextAnnotationAddedEvent);
197+
@@dynamicModel(ResponseQueuedEvent);
198+
@@dynamicModel(ResponseReasoningDeltaEvent);
199+
@@dynamicModel(ResponseReasoningDoneEvent);
200+
@@dynamicModel(ResponseReasoningSummaryDeltaEvent);
201+
@@dynamicModel(ResponseReasoningSummaryDoneEvent);
202+
@@dynamicModel(CodeInterpreterToolLogsOutput);
203+
@@dynamicModel(CodeInterpreterToolImageOutput);
204+
@@dynamicModel(ResponseAudioDeltaEvent);
205+
@@dynamicModel(ResponseAudioDoneEvent);
206+
@@dynamicModel(ResponseAudioTranscriptDeltaEvent);
207+
@@dynamicModel(ResponseAudioTranscriptDoneEvent);
208+
@@dynamicModel(ResponseCodeInterpreterCallCodeDeltaEvent);
209+
@@dynamicModel(ResponseCodeInterpreterCallCodeDoneEvent);
210+
@@dynamicModel(ResponseCodeInterpreterCallCompletedEvent);
211+
@@dynamicModel(ResponseCodeInterpreterCallInProgressEvent);
212+
@@dynamicModel(ResponseCodeInterpreterCallInterpretingEvent);
213+
@@dynamicModel(TopLogProb);
214+
@@dynamicModel(LogProb);
215+
// custom.tsp models
216+
@@dynamicModel(ResponseErrorResponse);
217+
@@dynamicModel(ReasoningItemSummaryPart);
218+
@@dynamicModel(ReasoningItemSummaryTextPart);
219+
@@dynamicModel(CodeInterpreterToolOutput);
220+
@@dynamicModel(CodeInterpreterContainerConfiguration);
221+
@@dynamicModel(ReasoningItemSummaryPartType);
222+
@@dynamicModel(CodeInterpreterToolOutputType);
223+
@@dynamicModel(CodeInterpreterContainerConfigurationType);
224+
// custom/items.tsp models
225+
@@dynamicModel(FileSearchToolCallItemParam);
226+
@@dynamicModel(FileSearchToolCallItemResource);
227+
@@dynamicModel(ComputerToolCallItemParam);
228+
@@dynamicModel(ComputerToolCallItemResource);
229+
@@dynamicModel(ComputerToolCallOutputItemParam);
230+
@@dynamicModel(ComputerToolCallOutputItemResource);
231+
@@dynamicModel(WebSearchToolCallItemParam);
232+
@@dynamicModel(WebSearchToolCallItemResource);
233+
@@dynamicModel(FunctionToolCallItemParam);
234+
@@dynamicModel(FunctionToolCallItemResource);
235+
@@dynamicModel(FunctionToolCallOutputItemParam);
236+
@@dynamicModel(FunctionToolCallOutputItemResource);
237+
@@dynamicModel(ReasoningItemParam);
238+
@@dynamicModel(ReasoningItemResource);
239+
@@dynamicModel(ItemReferenceItemParam);
240+
@@dynamicModel(ImageGenToolCallItemParam);
241+
@@dynamicModel(ImageGenToolCallItemResource);
242+
@@dynamicModel(CodeInterpreterToolCallItemParam);
243+
@@dynamicModel(CodeInterpreterToolCallItemResource);
244+
@@dynamicModel(LocalShellToolCallItemParam);
245+
@@dynamicModel(LocalShellToolCallItemResource);
246+
@@dynamicModel(LocalShellToolCallOutputItemParam);
247+
@@dynamicModel(LocalShellToolCallOutputItemResource);
248+
@@dynamicModel(MCPListToolsItemParam);
249+
@@dynamicModel(MCPListToolsItemResource);
250+
@@dynamicModel(MCPApprovalRequestItemParam);
251+
@@dynamicModel(MCPApprovalRequestItemResource);
252+
@@dynamicModel(MCPApprovalResponseItemParam);
253+
@@dynamicModel(MCPApprovalResponseItemResource);
254+
@@dynamicModel(MCPCallItemParam);
255+
@@dynamicModel(MCPCallItemResource);
256+
// custom/items.messages.tsp models
257+
@@dynamicModel(ResponsesMessageItemParam);
258+
@@dynamicModel(ResponsesUserMessageItemParam);
259+
@@dynamicModel(ResponsesSystemMessageItemParam);
260+
@@dynamicModel(ResponsesDeveloperMessageItemParam);
261+
@@dynamicModel(ResponsesAssistantMessageItemParam);
262+
@@dynamicModel(ResponsesMessageItemResource);
263+
@@dynamicModel(ResponsesUserMessageItemResource);
264+
@@dynamicModel(ResponsesSystemMessageItemResource);
265+
@@dynamicModel(ResponsesDeveloperMessageItemResource);
266+
@@dynamicModel(ResponsesAssistantMessageItemResource);
267+
@@dynamicModel(ImplicitUserMessage);
268+
// base/entrypoints/sdk.dotnet/specialized-types.tsp models
269+
@@dynamicModel(ComparisonFilter);
270+
@@dynamicModel(ComparisonFilterEquals);
271+
@@dynamicModel(ComparisonFilterNotEquals);
272+
@@dynamicModel(ComparisonFilterGreaterThan);
273+
@@dynamicModel(ComparisonFilterGreaterThanOrEquals);
274+
@@dynamicModel(ComparisonFilterLessThan);
275+
@@dynamicModel(ComparisonFilterLessThanOrEquals);
276+
@@dynamicModel(CompoundFilter);
277+
@@dynamicModel(CompoundFilterAnd);
278+
@@dynamicModel(CompoundFilterOr);
279+
// client/models/responses.models.tsp models
280+
@@dynamicModel(DotNetItemReferenceItemResource);
281+
@@dynamicModel(ResponseItemCollectionOrder);
282+
@@dynamicModel(ResponseItemCollectionOptions);
283+
@@dynamicModel(DotNetGlobalToolCallApprovalPolicy);
284+
@@dynamicModel(DotNetCustomToolCallApprovalPolicy);
285+
@@dynamicModel(DotNetToolCallApprovalPolicy);
286+
@@dynamicModel(DotNetCodeInterpreterToolContainer);
287+
// client/models/common.models.tsp models
288+
@@dynamicModel(DotNetResponseReasoningEffortLevel);
289+
@@dynamicModel(DotNetResponseServiceTier);

0 commit comments

Comments
 (0)