orq-ai-sdk 4.2.0rc49__py3-none-any.whl → 4.2.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. orq_ai_sdk/_hooks/globalhook.py +0 -1
  2. orq_ai_sdk/_version.py +3 -3
  3. orq_ai_sdk/audio.py +30 -0
  4. orq_ai_sdk/chat.py +22 -0
  5. orq_ai_sdk/completions.py +438 -0
  6. orq_ai_sdk/contacts.py +43 -886
  7. orq_ai_sdk/deployments.py +61 -0
  8. orq_ai_sdk/edits.py +364 -0
  9. orq_ai_sdk/embeddings.py +344 -0
  10. orq_ai_sdk/generations.py +370 -0
  11. orq_ai_sdk/images.py +28 -0
  12. orq_ai_sdk/models/__init__.py +3839 -424
  13. orq_ai_sdk/models/conversationresponse.py +1 -1
  14. orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
  15. orq_ai_sdk/models/createagentrequestop.py +768 -12
  16. orq_ai_sdk/models/createagentresponse.py +68 -2
  17. orq_ai_sdk/models/createchatcompletionop.py +538 -313
  18. orq_ai_sdk/models/createcompletionop.py +2078 -0
  19. orq_ai_sdk/models/createcontactop.py +5 -10
  20. orq_ai_sdk/models/createconversationop.py +1 -1
  21. orq_ai_sdk/models/createconversationresponseop.py +2 -2
  22. orq_ai_sdk/models/createdatasetitemop.py +4 -4
  23. orq_ai_sdk/models/createdatasetop.py +1 -1
  24. orq_ai_sdk/models/createdatasourceop.py +1 -1
  25. orq_ai_sdk/models/createembeddingop.py +579 -0
  26. orq_ai_sdk/models/createevalop.py +14 -14
  27. orq_ai_sdk/models/createidentityop.py +1 -1
  28. orq_ai_sdk/models/createimageeditop.py +715 -0
  29. orq_ai_sdk/models/createimageop.py +228 -82
  30. orq_ai_sdk/models/createimagevariationop.py +706 -0
  31. orq_ai_sdk/models/creatememoryop.py +4 -2
  32. orq_ai_sdk/models/createmoderationop.py +521 -0
  33. orq_ai_sdk/models/createpromptop.py +375 -6
  34. orq_ai_sdk/models/creatererankop.py +608 -0
  35. orq_ai_sdk/models/createresponseop.py +2567 -0
  36. orq_ai_sdk/models/createspeechop.py +466 -0
  37. orq_ai_sdk/models/createtoolop.py +6 -6
  38. orq_ai_sdk/models/createtranscriptionop.py +732 -0
  39. orq_ai_sdk/models/createtranslationop.py +702 -0
  40. orq_ai_sdk/models/deploymentgetconfigop.py +17 -7
  41. orq_ai_sdk/models/deploymentsop.py +1 -0
  42. orq_ai_sdk/models/deploymentstreamop.py +7 -0
  43. orq_ai_sdk/models/filegetop.py +1 -1
  44. orq_ai_sdk/models/filelistop.py +1 -1
  45. orq_ai_sdk/models/fileuploadop.py +1 -1
  46. orq_ai_sdk/models/generateconversationnameop.py +1 -1
  47. orq_ai_sdk/models/getallmemoriesop.py +4 -2
  48. orq_ai_sdk/models/getallpromptsop.py +188 -3
  49. orq_ai_sdk/models/getalltoolsop.py +6 -6
  50. orq_ai_sdk/models/getevalsop.py +17 -17
  51. orq_ai_sdk/models/getonepromptop.py +188 -3
  52. orq_ai_sdk/models/getpromptversionop.py +188 -3
  53. orq_ai_sdk/models/invokedeploymentrequest.py +11 -4
  54. orq_ai_sdk/models/listagentsop.py +372 -0
  55. orq_ai_sdk/models/listdatasetdatapointsop.py +4 -4
  56. orq_ai_sdk/models/listdatasetsop.py +1 -1
  57. orq_ai_sdk/models/listdatasourcesop.py +1 -1
  58. orq_ai_sdk/models/listidentitiesop.py +1 -1
  59. orq_ai_sdk/models/listmodelsop.py +1 -0
  60. orq_ai_sdk/models/listpromptversionsop.py +188 -3
  61. orq_ai_sdk/models/partdoneevent.py +1 -1
  62. orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
  63. orq_ai_sdk/models/publiccontact.py +9 -3
  64. orq_ai_sdk/models/publicidentity.py +62 -0
  65. orq_ai_sdk/models/reasoningpart.py +1 -1
  66. orq_ai_sdk/models/responsedoneevent.py +14 -11
  67. orq_ai_sdk/models/retrieveagentrequestop.py +382 -0
  68. orq_ai_sdk/models/retrievedatapointop.py +4 -4
  69. orq_ai_sdk/models/retrievedatasetop.py +1 -1
  70. orq_ai_sdk/models/retrievedatasourceop.py +1 -1
  71. orq_ai_sdk/models/retrieveidentityop.py +1 -1
  72. orq_ai_sdk/models/retrievememoryop.py +4 -2
  73. orq_ai_sdk/models/retrievetoolop.py +6 -6
  74. orq_ai_sdk/models/runagentop.py +379 -9
  75. orq_ai_sdk/models/streamrunagentop.py +385 -9
  76. orq_ai_sdk/models/updateagentop.py +770 -12
  77. orq_ai_sdk/models/updateconversationop.py +1 -1
  78. orq_ai_sdk/models/updatedatapointop.py +4 -4
  79. orq_ai_sdk/models/updatedatasetop.py +1 -1
  80. orq_ai_sdk/models/updatedatasourceop.py +1 -1
  81. orq_ai_sdk/models/updateevalop.py +14 -14
  82. orq_ai_sdk/models/updateidentityop.py +1 -1
  83. orq_ai_sdk/models/updatememoryop.py +4 -2
  84. orq_ai_sdk/models/updatepromptop.py +375 -6
  85. orq_ai_sdk/models/updatetoolop.py +7 -7
  86. orq_ai_sdk/moderations.py +218 -0
  87. orq_ai_sdk/orq_completions.py +666 -0
  88. orq_ai_sdk/orq_responses.py +398 -0
  89. orq_ai_sdk/rerank.py +330 -0
  90. orq_ai_sdk/router.py +89 -641
  91. orq_ai_sdk/speech.py +333 -0
  92. orq_ai_sdk/transcriptions.py +416 -0
  93. orq_ai_sdk/translations.py +384 -0
  94. orq_ai_sdk/variations.py +364 -0
  95. orq_ai_sdk-4.2.12.dist-info/METADATA +888 -0
  96. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/RECORD +98 -75
  97. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/WHEEL +1 -1
  98. orq_ai_sdk/models/deletecontactop.py +0 -44
  99. orq_ai_sdk/models/listcontactsop.py +0 -265
  100. orq_ai_sdk/models/retrievecontactop.py +0 -142
  101. orq_ai_sdk/models/updatecontactop.py +0 -233
  102. orq_ai_sdk-4.2.0rc49.dist-info/METADATA +0 -788
  103. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/top_level.txt +0 -0
@@ -11,6 +11,7 @@ from .imagecontentpartschema import (
11
11
  ImageContentPartSchemaTypedDict,
12
12
  )
13
13
  from .publiccontact import PublicContact, PublicContactTypedDict
14
+ from .publicidentity import PublicIdentity, PublicIdentityTypedDict
14
15
  from .reasoningpartschema import ReasoningPartSchema, ReasoningPartSchemaTypedDict
15
16
  from .redactedreasoningpartschema import (
16
17
  RedactedReasoningPartSchema,
@@ -46,31 +47,37 @@ from typing_extensions import (
46
47
  )
47
48
 
48
49
 
49
- CreateChatCompletionMessagesRouterRequestRequestBody5Role = Literal["tool",]
50
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5Role = Literal[
51
+ "tool",
52
+ ]
50
53
  r"""The role of the messages author, in this case tool."""
51
54
 
52
55
 
53
- CreateChatCompletionContentRouterRequest2TypedDict = TextContentPartSchemaTypedDict
56
+ CreateChatCompletionContentRouterChatCompletionsRequest2TypedDict = (
57
+ TextContentPartSchemaTypedDict
58
+ )
54
59
 
55
60
 
56
- CreateChatCompletionContentRouterRequest2 = TextContentPartSchema
61
+ CreateChatCompletionContentRouterChatCompletionsRequest2 = TextContentPartSchema
57
62
 
58
63
 
59
- CreateChatCompletionMessagesRouterRequestRequestBody5ContentTypedDict = TypeAliasType(
60
- "CreateChatCompletionMessagesRouterRequestRequestBody5ContentTypedDict",
61
- Union[str, List[CreateChatCompletionContentRouterRequest2TypedDict]],
64
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5ContentTypedDict = TypeAliasType(
65
+ "CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5ContentTypedDict",
66
+ Union[str, List[CreateChatCompletionContentRouterChatCompletionsRequest2TypedDict]],
62
67
  )
63
68
  r"""The contents of the tool message."""
64
69
 
65
70
 
66
- CreateChatCompletionMessagesRouterRequestRequestBody5Content = TypeAliasType(
67
- "CreateChatCompletionMessagesRouterRequestRequestBody5Content",
68
- Union[str, List[CreateChatCompletionContentRouterRequest2]],
71
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5Content = (
72
+ TypeAliasType(
73
+ "CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5Content",
74
+ Union[str, List[CreateChatCompletionContentRouterChatCompletionsRequest2]],
75
+ )
69
76
  )
70
77
  r"""The contents of the tool message."""
71
78
 
72
79
 
73
- CreateChatCompletionMessagesRouterType = Literal["ephemeral",]
80
+ CreateChatCompletionMessagesRouterChatCompletionsType = Literal["ephemeral",]
74
81
  r"""Create a cache control breakpoint at this content block. Accepts only the value \"ephemeral\"."""
75
82
 
76
83
 
@@ -88,7 +95,7 @@ Defaults to `5m`. Only supported by `Anthropic` Claude models.
88
95
 
89
96
 
90
97
  class CreateChatCompletionMessagesCacheControlTypedDict(TypedDict):
91
- type: CreateChatCompletionMessagesRouterType
98
+ type: CreateChatCompletionMessagesRouterChatCompletionsType
92
99
  r"""Create a cache control breakpoint at this content block. Accepts only the value \"ephemeral\"."""
93
100
  ttl: NotRequired[CreateChatCompletionMessagesTTL]
94
101
  r"""The time-to-live for the cache control breakpoint. This may be one of the following values:
@@ -101,7 +108,7 @@ class CreateChatCompletionMessagesCacheControlTypedDict(TypedDict):
101
108
 
102
109
 
103
110
  class CreateChatCompletionMessagesCacheControl(BaseModel):
104
- type: CreateChatCompletionMessagesRouterType
111
+ type: CreateChatCompletionMessagesRouterChatCompletionsType
105
112
  r"""Create a cache control breakpoint at this content block. Accepts only the value \"ephemeral\"."""
106
113
 
107
114
  ttl: Optional[CreateChatCompletionMessagesTTL] = "5m"
@@ -131,9 +138,9 @@ class CreateChatCompletionMessagesCacheControl(BaseModel):
131
138
 
132
139
 
133
140
  class CreateChatCompletionMessagesToolMessageTypedDict(TypedDict):
134
- role: CreateChatCompletionMessagesRouterRequestRequestBody5Role
141
+ role: CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5Role
135
142
  r"""The role of the messages author, in this case tool."""
136
- content: CreateChatCompletionMessagesRouterRequestRequestBody5ContentTypedDict
143
+ content: CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5ContentTypedDict
137
144
  r"""The contents of the tool message."""
138
145
  tool_call_id: Nullable[str]
139
146
  r"""Tool call that this message is responding to."""
@@ -141,10 +148,10 @@ class CreateChatCompletionMessagesToolMessageTypedDict(TypedDict):
141
148
 
142
149
 
143
150
  class CreateChatCompletionMessagesToolMessage(BaseModel):
144
- role: CreateChatCompletionMessagesRouterRequestRequestBody5Role
151
+ role: CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5Role
145
152
  r"""The role of the messages author, in this case tool."""
146
153
 
147
- content: CreateChatCompletionMessagesRouterRequestRequestBody5Content
154
+ content: CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBody5Content
148
155
  r"""The contents of the tool message."""
149
156
 
150
157
  tool_call_id: Nullable[str]
@@ -178,8 +185,8 @@ class CreateChatCompletionMessagesToolMessage(BaseModel):
178
185
  return m
179
186
 
180
187
 
181
- CreateChatCompletionContentRouter2TypedDict = TypeAliasType(
182
- "CreateChatCompletionContentRouter2TypedDict",
188
+ CreateChatCompletionContentRouterChatCompletions2TypedDict = TypeAliasType(
189
+ "CreateChatCompletionContentRouterChatCompletions2TypedDict",
183
190
  Union[
184
191
  RefusalPartSchemaTypedDict,
185
192
  RedactedReasoningPartSchemaTypedDict,
@@ -189,7 +196,7 @@ CreateChatCompletionContentRouter2TypedDict = TypeAliasType(
189
196
  )
190
197
 
191
198
 
192
- CreateChatCompletionContentRouter2 = Annotated[
199
+ CreateChatCompletionContentRouterChatCompletions2 = Annotated[
193
200
  Union[
194
201
  Annotated[TextContentPartSchema, Tag("text")],
195
202
  Annotated[RefusalPartSchema, Tag("refusal")],
@@ -200,21 +207,25 @@ CreateChatCompletionContentRouter2 = Annotated[
200
207
  ]
201
208
 
202
209
 
203
- CreateChatCompletionMessagesRouterRequestRequestBodyContentTypedDict = TypeAliasType(
204
- "CreateChatCompletionMessagesRouterRequestRequestBodyContentTypedDict",
205
- Union[str, List[CreateChatCompletionContentRouter2TypedDict]],
210
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyContentTypedDict = TypeAliasType(
211
+ "CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyContentTypedDict",
212
+ Union[str, List[CreateChatCompletionContentRouterChatCompletions2TypedDict]],
206
213
  )
207
214
  r"""The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified."""
208
215
 
209
216
 
210
- CreateChatCompletionMessagesRouterRequestRequestBodyContent = TypeAliasType(
211
- "CreateChatCompletionMessagesRouterRequestRequestBodyContent",
212
- Union[str, List[CreateChatCompletionContentRouter2]],
217
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyContent = (
218
+ TypeAliasType(
219
+ "CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyContent",
220
+ Union[str, List[CreateChatCompletionContentRouterChatCompletions2]],
221
+ )
213
222
  )
214
223
  r"""The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified."""
215
224
 
216
225
 
217
- CreateChatCompletionMessagesRouterRequestRequestBodyRole = Literal["assistant",]
226
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyRole = Literal[
227
+ "assistant",
228
+ ]
218
229
  r"""The role of the messages author, in this case `assistant`."""
219
230
 
220
231
 
@@ -307,10 +318,12 @@ class CreateChatCompletionMessagesToolCalls(BaseModel):
307
318
 
308
319
 
309
320
  class CreateChatCompletionMessagesAssistantMessageTypedDict(TypedDict):
310
- role: CreateChatCompletionMessagesRouterRequestRequestBodyRole
321
+ role: CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyRole
311
322
  r"""The role of the messages author, in this case `assistant`."""
312
323
  content: NotRequired[
313
- Nullable[CreateChatCompletionMessagesRouterRequestRequestBodyContentTypedDict]
324
+ Nullable[
325
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyContentTypedDict
326
+ ]
314
327
  ]
315
328
  r"""The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified."""
316
329
  refusal: NotRequired[Nullable[str]]
@@ -324,11 +337,11 @@ class CreateChatCompletionMessagesAssistantMessageTypedDict(TypedDict):
324
337
 
325
338
 
326
339
  class CreateChatCompletionMessagesAssistantMessage(BaseModel):
327
- role: CreateChatCompletionMessagesRouterRequestRequestBodyRole
340
+ role: CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyRole
328
341
  r"""The role of the messages author, in this case `assistant`."""
329
342
 
330
343
  content: OptionalNullable[
331
- CreateChatCompletionMessagesRouterRequestRequestBodyContent
344
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRequestBodyContent
332
345
  ] = UNSET
333
346
  r"""The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified."""
334
347
 
@@ -370,7 +383,7 @@ class CreateChatCompletionMessagesAssistantMessage(BaseModel):
370
383
  return m
371
384
 
372
385
 
373
- CreateChatCompletionMessagesRouterRequestRole = Literal["user",]
386
+ CreateChatCompletionMessagesRouterChatCompletionsRequestRole = Literal["user",]
374
387
  r"""The role of the messages author, in this case `user`."""
375
388
 
376
389
 
@@ -378,7 +391,7 @@ CreateChatCompletion2Type = Literal["file",]
378
391
  r"""The type of the content part. Always `file`."""
379
392
 
380
393
 
381
- CreateChatCompletion2RouterType = Literal["ephemeral",]
394
+ CreateChatCompletion2RouterChatCompletionsType = Literal["ephemeral",]
382
395
  r"""Create a cache control breakpoint at this content block. Accepts only the value \"ephemeral\"."""
383
396
 
384
397
 
@@ -396,7 +409,7 @@ Defaults to `5m`. Only supported by `Anthropic` Claude models.
396
409
 
397
410
 
398
411
  class CreateChatCompletion2CacheControlTypedDict(TypedDict):
399
- type: CreateChatCompletion2RouterType
412
+ type: CreateChatCompletion2RouterChatCompletionsType
400
413
  r"""Create a cache control breakpoint at this content block. Accepts only the value \"ephemeral\"."""
401
414
  ttl: NotRequired[CreateChatCompletion2TTL]
402
415
  r"""The time-to-live for the cache control breakpoint. This may be one of the following values:
@@ -409,7 +422,7 @@ class CreateChatCompletion2CacheControlTypedDict(TypedDict):
409
422
 
410
423
 
411
424
  class CreateChatCompletion2CacheControl(BaseModel):
412
- type: CreateChatCompletion2RouterType
425
+ type: CreateChatCompletion2RouterChatCompletionsType
413
426
  r"""Create a cache control breakpoint at this content block. Accepts only the value \"ephemeral\"."""
414
427
 
415
428
  ttl: Optional[CreateChatCompletion2TTL] = "5m"
@@ -494,34 +507,36 @@ CreateChatCompletionContent2 = Annotated[
494
507
  ]
495
508
 
496
509
 
497
- CreateChatCompletionMessagesRouterRequestContentTypedDict = TypeAliasType(
498
- "CreateChatCompletionMessagesRouterRequestContentTypedDict",
499
- Union[str, List[CreateChatCompletionContent2TypedDict]],
510
+ CreateChatCompletionMessagesRouterChatCompletionsRequestContentTypedDict = (
511
+ TypeAliasType(
512
+ "CreateChatCompletionMessagesRouterChatCompletionsRequestContentTypedDict",
513
+ Union[str, List[CreateChatCompletionContent2TypedDict]],
514
+ )
500
515
  )
501
516
  r"""The contents of the user message."""
502
517
 
503
518
 
504
- CreateChatCompletionMessagesRouterRequestContent = TypeAliasType(
505
- "CreateChatCompletionMessagesRouterRequestContent",
519
+ CreateChatCompletionMessagesRouterChatCompletionsRequestContent = TypeAliasType(
520
+ "CreateChatCompletionMessagesRouterChatCompletionsRequestContent",
506
521
  Union[str, List[CreateChatCompletionContent2]],
507
522
  )
508
523
  r"""The contents of the user message."""
509
524
 
510
525
 
511
526
  class CreateChatCompletionMessagesUserMessageTypedDict(TypedDict):
512
- role: CreateChatCompletionMessagesRouterRequestRole
527
+ role: CreateChatCompletionMessagesRouterChatCompletionsRequestRole
513
528
  r"""The role of the messages author, in this case `user`."""
514
- content: CreateChatCompletionMessagesRouterRequestContentTypedDict
529
+ content: CreateChatCompletionMessagesRouterChatCompletionsRequestContentTypedDict
515
530
  r"""The contents of the user message."""
516
531
  name: NotRequired[str]
517
532
  r"""An optional name for the participant. Provides the model information to differentiate between participants of the same role."""
518
533
 
519
534
 
520
535
  class CreateChatCompletionMessagesUserMessage(BaseModel):
521
- role: CreateChatCompletionMessagesRouterRequestRole
536
+ role: CreateChatCompletionMessagesRouterChatCompletionsRequestRole
522
537
  r"""The role of the messages author, in this case `user`."""
523
538
 
524
- content: CreateChatCompletionMessagesRouterRequestContent
539
+ content: CreateChatCompletionMessagesRouterChatCompletionsRequestContent
525
540
  r"""The contents of the user message."""
526
541
 
527
542
  name: Optional[str] = None
@@ -544,37 +559,38 @@ class CreateChatCompletionMessagesUserMessage(BaseModel):
544
559
  return m
545
560
 
546
561
 
547
- CreateChatCompletionMessagesRouterRole = Literal["developer",]
562
+ CreateChatCompletionMessagesRouterChatCompletionsRole = Literal["developer",]
548
563
  r"""The role of the messages author, in this case `developer`."""
549
564
 
550
565
 
551
- CreateChatCompletionMessagesRouterContentTypedDict = TypeAliasType(
552
- "CreateChatCompletionMessagesRouterContentTypedDict",
566
+ CreateChatCompletionMessagesRouterChatCompletionsContentTypedDict = TypeAliasType(
567
+ "CreateChatCompletionMessagesRouterChatCompletionsContentTypedDict",
553
568
  Union[str, List[TextContentPartSchemaTypedDict]],
554
569
  )
555
570
  r"""The contents of the developer message."""
556
571
 
557
572
 
558
- CreateChatCompletionMessagesRouterContent = TypeAliasType(
559
- "CreateChatCompletionMessagesRouterContent", Union[str, List[TextContentPartSchema]]
573
+ CreateChatCompletionMessagesRouterChatCompletionsContent = TypeAliasType(
574
+ "CreateChatCompletionMessagesRouterChatCompletionsContent",
575
+ Union[str, List[TextContentPartSchema]],
560
576
  )
561
577
  r"""The contents of the developer message."""
562
578
 
563
579
 
564
580
  class CreateChatCompletionMessagesDeveloperMessageTypedDict(TypedDict):
565
- role: CreateChatCompletionMessagesRouterRole
581
+ role: CreateChatCompletionMessagesRouterChatCompletionsRole
566
582
  r"""The role of the messages author, in this case `developer`."""
567
- content: CreateChatCompletionMessagesRouterContentTypedDict
583
+ content: CreateChatCompletionMessagesRouterChatCompletionsContentTypedDict
568
584
  r"""The contents of the developer message."""
569
585
  name: NotRequired[str]
570
586
  r"""An optional name for the participant. Provides the model information to differentiate between participants of the same role."""
571
587
 
572
588
 
573
589
  class CreateChatCompletionMessagesDeveloperMessage(BaseModel):
574
- role: CreateChatCompletionMessagesRouterRole
590
+ role: CreateChatCompletionMessagesRouterChatCompletionsRole
575
591
  r"""The role of the messages author, in this case `developer`."""
576
592
 
577
- content: CreateChatCompletionMessagesRouterContent
593
+ content: CreateChatCompletionMessagesRouterChatCompletionsContent
578
594
  r"""The contents of the developer message."""
579
595
 
580
596
  name: Optional[str] = None
@@ -718,10 +734,14 @@ class CreateChatCompletionAudio(BaseModel):
718
734
  r"""Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16."""
719
735
 
720
736
 
721
- CreateChatCompletionResponseFormatRouterRequestType = Literal["json_schema",]
737
+ CreateChatCompletionResponseFormatRouterChatCompletionsRequestType = Literal[
738
+ "json_schema",
739
+ ]
722
740
 
723
741
 
724
- class CreateChatCompletionResponseFormatRouterJSONSchemaTypedDict(TypedDict):
742
+ class CreateChatCompletionResponseFormatRouterChatCompletionsJSONSchemaTypedDict(
743
+ TypedDict
744
+ ):
725
745
  name: str
726
746
  r"""The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."""
727
747
  description: NotRequired[str]
@@ -732,7 +752,7 @@ class CreateChatCompletionResponseFormatRouterJSONSchemaTypedDict(TypedDict):
732
752
  r"""Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true."""
733
753
 
734
754
 
735
- class CreateChatCompletionResponseFormatRouterJSONSchema(BaseModel):
755
+ class CreateChatCompletionResponseFormatRouterChatCompletionsJSONSchema(BaseModel):
736
756
  name: str
737
757
  r"""The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."""
738
758
 
@@ -768,8 +788,10 @@ class CreateChatCompletionResponseFormatJSONSchemaTypedDict(TypedDict):
768
788
  JSON Schema response format. Used to generate structured JSON responses
769
789
  """
770
790
 
771
- type: CreateChatCompletionResponseFormatRouterRequestType
772
- json_schema: CreateChatCompletionResponseFormatRouterJSONSchemaTypedDict
791
+ type: CreateChatCompletionResponseFormatRouterChatCompletionsRequestType
792
+ json_schema: (
793
+ CreateChatCompletionResponseFormatRouterChatCompletionsJSONSchemaTypedDict
794
+ )
773
795
 
774
796
 
775
797
  class CreateChatCompletionResponseFormatJSONSchema(BaseModel):
@@ -778,12 +800,12 @@ class CreateChatCompletionResponseFormatJSONSchema(BaseModel):
778
800
  JSON Schema response format. Used to generate structured JSON responses
779
801
  """
780
802
 
781
- type: CreateChatCompletionResponseFormatRouterRequestType
803
+ type: CreateChatCompletionResponseFormatRouterChatCompletionsRequestType
782
804
 
783
- json_schema: CreateChatCompletionResponseFormatRouterJSONSchema
805
+ json_schema: CreateChatCompletionResponseFormatRouterChatCompletionsJSONSchema
784
806
 
785
807
 
786
- CreateChatCompletionResponseFormatRouterType = Literal["json_object",]
808
+ CreateChatCompletionResponseFormatRouterChatCompletionsType = Literal["json_object",]
787
809
 
788
810
 
789
811
  class CreateChatCompletionResponseFormatJSONObjectTypedDict(TypedDict):
@@ -792,7 +814,7 @@ class CreateChatCompletionResponseFormatJSONObjectTypedDict(TypedDict):
792
814
  JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
793
815
  """
794
816
 
795
- type: CreateChatCompletionResponseFormatRouterType
817
+ type: CreateChatCompletionResponseFormatRouterChatCompletionsType
796
818
 
797
819
 
798
820
  class CreateChatCompletionResponseFormatJSONObject(BaseModel):
@@ -801,7 +823,7 @@ class CreateChatCompletionResponseFormatJSONObject(BaseModel):
801
823
  JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
802
824
  """
803
825
 
804
- type: CreateChatCompletionResponseFormatRouterType
826
+ type: CreateChatCompletionResponseFormatRouterChatCompletionsType
805
827
 
806
828
 
807
829
  CreateChatCompletionResponseFormatType = Literal["text",]
@@ -927,13 +949,13 @@ CreateChatCompletionType = Literal["function",]
927
949
  r"""The type of the tool. Currently, only function is supported."""
928
950
 
929
951
 
930
- CreateChatCompletionRouterType = Literal["object",]
952
+ CreateChatCompletionRouterChatCompletionsType = Literal["object",]
931
953
 
932
954
 
933
955
  class CreateChatCompletionParametersTypedDict(TypedDict):
934
956
  r"""The parameters the functions accepts, described as a JSON Schema object"""
935
957
 
936
- type: CreateChatCompletionRouterType
958
+ type: CreateChatCompletionRouterChatCompletionsType
937
959
  properties: Dict[str, Any]
938
960
  required: NotRequired[List[str]]
939
961
  additional_properties: NotRequired[bool]
@@ -942,7 +964,7 @@ class CreateChatCompletionParametersTypedDict(TypedDict):
942
964
  class CreateChatCompletionParameters(BaseModel):
943
965
  r"""The parameters the functions accepts, described as a JSON Schema object"""
944
966
 
945
- type: CreateChatCompletionRouterType
967
+ type: CreateChatCompletionRouterChatCompletionsType
946
968
 
947
969
  properties: Dict[str, Any]
948
970
 
@@ -1147,6 +1169,16 @@ class CreateChatCompletionGuardrails(BaseModel):
1147
1169
  r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
1148
1170
 
1149
1171
 
1172
+ class CreateChatCompletionFallbacksTypedDict(TypedDict):
1173
+ model: str
1174
+ r"""Fallback model identifier"""
1175
+
1176
+
1177
+ class CreateChatCompletionFallbacks(BaseModel):
1178
+ model: str
1179
+ r"""Fallback model identifier"""
1180
+
1181
+
1150
1182
  class CreateChatCompletionRetryTypedDict(TypedDict):
1151
1183
  r"""Retry configuration for the request"""
1152
1184
 
@@ -1182,86 +1214,130 @@ class CreateChatCompletionRetry(BaseModel):
1182
1214
  return m
1183
1215
 
1184
1216
 
1185
- class FallbacksTypedDict(TypedDict):
1217
+ CreateChatCompletionRouterChatCompletionsRequestType = Literal["exact_match",]
1218
+
1219
+
1220
+ class CreateChatCompletionCacheTypedDict(TypedDict):
1221
+ r"""Cache configuration for the request."""
1222
+
1223
+ type: CreateChatCompletionRouterChatCompletionsRequestType
1224
+ ttl: NotRequired[float]
1225
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
1226
+
1227
+
1228
+ class CreateChatCompletionCache(BaseModel):
1229
+ r"""Cache configuration for the request."""
1230
+
1231
+ type: CreateChatCompletionRouterChatCompletionsRequestType
1232
+
1233
+ ttl: Optional[float] = 1800
1234
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
1235
+
1236
+ @model_serializer(mode="wrap")
1237
+ def serialize_model(self, handler):
1238
+ optional_fields = set(["ttl"])
1239
+ serialized = handler(self)
1240
+ m = {}
1241
+
1242
+ for n, f in type(self).model_fields.items():
1243
+ k = f.alias or n
1244
+ val = serialized.get(k)
1245
+
1246
+ if val != UNSET_SENTINEL:
1247
+ if val is not None or k not in optional_fields:
1248
+ m[k] = val
1249
+
1250
+ return m
1251
+
1252
+
1253
+ CreateChatCompletionLoadBalancerType = Literal["weight_based",]
1254
+
1255
+
1256
+ class CreateChatCompletionLoadBalancerModelsTypedDict(TypedDict):
1186
1257
  model: str
1187
- r"""Fallback model identifier"""
1258
+ r"""Model identifier for load balancing"""
1259
+ weight: NotRequired[float]
1260
+ r"""Weight assigned to this model for load balancing"""
1188
1261
 
1189
1262
 
1190
- class Fallbacks(BaseModel):
1263
+ class CreateChatCompletionLoadBalancerModels(BaseModel):
1191
1264
  model: str
1192
- r"""Fallback model identifier"""
1265
+ r"""Model identifier for load balancing"""
1193
1266
 
1267
+ weight: Optional[float] = 0.5
1268
+ r"""Weight assigned to this model for load balancing"""
1194
1269
 
1195
- Version = Literal["latest",]
1196
- r"""Version of the prompt to use (currently only \"latest\" supported)"""
1270
+ @model_serializer(mode="wrap")
1271
+ def serialize_model(self, handler):
1272
+ optional_fields = set(["weight"])
1273
+ serialized = handler(self)
1274
+ m = {}
1197
1275
 
1276
+ for n, f in type(self).model_fields.items():
1277
+ k = f.alias or n
1278
+ val = serialized.get(k)
1198
1279
 
1199
- class PromptTypedDict(TypedDict):
1200
- r"""Prompt configuration for the request"""
1280
+ if val != UNSET_SENTINEL:
1281
+ if val is not None or k not in optional_fields:
1282
+ m[k] = val
1201
1283
 
1202
- id: str
1203
- r"""Unique identifier of the prompt to use"""
1204
- version: Version
1205
- r"""Version of the prompt to use (currently only \"latest\" supported)"""
1284
+ return m
1206
1285
 
1207
1286
 
1208
- class Prompt(BaseModel):
1209
- r"""Prompt configuration for the request"""
1287
+ class CreateChatCompletionLoadBalancer1TypedDict(TypedDict):
1288
+ type: CreateChatCompletionLoadBalancerType
1289
+ models: List[CreateChatCompletionLoadBalancerModelsTypedDict]
1210
1290
 
1211
- id: str
1212
- r"""Unique identifier of the prompt to use"""
1213
1291
 
1214
- version: Version
1215
- r"""Version of the prompt to use (currently only \"latest\" supported)"""
1292
+ class CreateChatCompletionLoadBalancer1(BaseModel):
1293
+ type: CreateChatCompletionLoadBalancerType
1216
1294
 
1295
+ models: List[CreateChatCompletionLoadBalancerModels]
1217
1296
 
1218
- @deprecated(
1219
- "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1220
- )
1221
- class CreateChatCompletionContactTypedDict(TypedDict):
1222
- r"""@deprecated Use identity instead. Information about the contact making the request."""
1223
1297
 
1224
- id: str
1225
- r"""Unique identifier for the contact"""
1226
- display_name: NotRequired[str]
1227
- r"""Display name of the contact"""
1228
- email: NotRequired[str]
1229
- r"""Email address of the contact"""
1230
- metadata: NotRequired[List[Dict[str, Any]]]
1231
- r"""A hash of key/value pairs containing any other data about the contact"""
1232
- logo_url: NotRequired[str]
1233
- r"""URL to the contact's avatar or logo"""
1234
- tags: NotRequired[List[str]]
1235
- r"""A list of tags associated with the contact"""
1298
+ CreateChatCompletionLoadBalancerTypedDict = CreateChatCompletionLoadBalancer1TypedDict
1299
+ r"""Load balancer configuration for the request."""
1236
1300
 
1237
1301
 
1238
- @deprecated(
1239
- "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1240
- )
1241
- class CreateChatCompletionContact(BaseModel):
1242
- r"""@deprecated Use identity instead. Information about the contact making the request."""
1302
+ CreateChatCompletionLoadBalancer = CreateChatCompletionLoadBalancer1
1303
+ r"""Load balancer configuration for the request."""
1243
1304
 
1244
- id: str
1245
- r"""Unique identifier for the contact"""
1246
1305
 
1247
- display_name: Optional[str] = None
1248
- r"""Display name of the contact"""
1306
+ class CreateChatCompletionTimeoutTypedDict(TypedDict):
1307
+ r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
1249
1308
 
1250
- email: Optional[str] = None
1251
- r"""Email address of the contact"""
1309
+ call_timeout: float
1310
+ r"""Timeout value in milliseconds"""
1252
1311
 
1253
- metadata: Optional[List[Dict[str, Any]]] = None
1254
- r"""A hash of key/value pairs containing any other data about the contact"""
1255
1312
 
1256
- logo_url: Optional[str] = None
1257
- r"""URL to the contact's avatar or logo"""
1313
+ class CreateChatCompletionTimeout(BaseModel):
1314
+ r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
1315
+
1316
+ call_timeout: float
1317
+ r"""Timeout value in milliseconds"""
1318
+
1319
+
1320
+ class CreateChatCompletionRouterChatCompletionsRetryTypedDict(TypedDict):
1321
+ r"""Retry configuration for the request"""
1322
+
1323
+ count: NotRequired[float]
1324
+ r"""Number of retry attempts (1-5)"""
1325
+ on_codes: NotRequired[List[float]]
1326
+ r"""HTTP status codes that trigger retry logic"""
1258
1327
 
1259
- tags: Optional[List[str]] = None
1260
- r"""A list of tags associated with the contact"""
1328
+
1329
+ class CreateChatCompletionRouterChatCompletionsRetry(BaseModel):
1330
+ r"""Retry configuration for the request"""
1331
+
1332
+ count: Optional[float] = 3
1333
+ r"""Number of retry attempts (1-5)"""
1334
+
1335
+ on_codes: Optional[List[float]] = None
1336
+ r"""HTTP status codes that trigger retry logic"""
1261
1337
 
1262
1338
  @model_serializer(mode="wrap")
1263
1339
  def serialize_model(self, handler):
1264
- optional_fields = set(["display_name", "email", "metadata", "logo_url", "tags"])
1340
+ optional_fields = set(["count", "on_codes"])
1265
1341
  serialized = handler(self)
1266
1342
  m = {}
1267
1343
 
@@ -1276,6 +1352,39 @@ class CreateChatCompletionContact(BaseModel):
1276
1352
  return m
1277
1353
 
1278
1354
 
1355
+ class CreateChatCompletionRouterChatCompletionsFallbacksTypedDict(TypedDict):
1356
+ model: str
1357
+ r"""Fallback model identifier"""
1358
+
1359
+
1360
+ class CreateChatCompletionRouterChatCompletionsFallbacks(BaseModel):
1361
+ model: str
1362
+ r"""Fallback model identifier"""
1363
+
1364
+
1365
+ Version = Literal["latest",]
1366
+ r"""Version of the prompt to use (currently only \"latest\" supported)"""
1367
+
1368
+
1369
+ class PromptTypedDict(TypedDict):
1370
+ r"""Prompt configuration for the request"""
1371
+
1372
+ id: str
1373
+ r"""Unique identifier of the prompt to use"""
1374
+ version: Version
1375
+ r"""Version of the prompt to use (currently only \"latest\" supported)"""
1376
+
1377
+
1378
+ class Prompt(BaseModel):
1379
+ r"""Prompt configuration for the request"""
1380
+
1381
+ id: str
1382
+ r"""Unique identifier of the prompt to use"""
1383
+
1384
+ version: Version
1385
+ r"""Version of the prompt to use (currently only \"latest\" supported)"""
1386
+
1387
+
1279
1388
  class CreateChatCompletionThreadTypedDict(TypedDict):
1280
1389
  r"""Thread information to group related requests"""
1281
1390
 
@@ -1351,21 +1460,23 @@ Inputs = TypeAliasType("Inputs", Union[Dict[str, Any], List[Inputs2]])
1351
1460
  r"""Values to replace in the prompt messages using {{variableName}} syntax"""
1352
1461
 
1353
1462
 
1354
- CreateChatCompletionRouterRequestType = Literal["exact_match",]
1463
+ CreateChatCompletionRouterChatCompletionsRequestRequestBodyType = Literal[
1464
+ "exact_match",
1465
+ ]
1355
1466
 
1356
1467
 
1357
- class CacheTypedDict(TypedDict):
1468
+ class CreateChatCompletionRouterChatCompletionsCacheTypedDict(TypedDict):
1358
1469
  r"""Cache configuration for the request."""
1359
1470
 
1360
- type: CreateChatCompletionRouterRequestType
1471
+ type: CreateChatCompletionRouterChatCompletionsRequestRequestBodyType
1361
1472
  ttl: NotRequired[float]
1362
1473
  r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
1363
1474
 
1364
1475
 
1365
- class Cache(BaseModel):
1476
+ class CreateChatCompletionRouterChatCompletionsCache(BaseModel):
1366
1477
  r"""Cache configuration for the request."""
1367
1478
 
1368
- type: CreateChatCompletionRouterRequestType
1479
+ type: CreateChatCompletionRouterChatCompletionsRequestRequestBodyType
1369
1480
 
1370
1481
  ttl: Optional[float] = 1800
1371
1482
  r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
@@ -1407,48 +1518,50 @@ class CreateChatCompletionOrExists(BaseModel):
1407
1518
  exists: bool
1408
1519
 
1409
1520
 
1410
- CreateChatCompletionOrRouterNinTypedDict = TypeAliasType(
1411
- "CreateChatCompletionOrRouterNinTypedDict", Union[str, float, bool]
1521
+ CreateChatCompletionOrRouterChatCompletionsNinTypedDict = TypeAliasType(
1522
+ "CreateChatCompletionOrRouterChatCompletionsNinTypedDict", Union[str, float, bool]
1412
1523
  )
1413
1524
 
1414
1525
 
1415
- CreateChatCompletionOrRouterNin = TypeAliasType(
1416
- "CreateChatCompletionOrRouterNin", Union[str, float, bool]
1526
+ CreateChatCompletionOrRouterChatCompletionsNin = TypeAliasType(
1527
+ "CreateChatCompletionOrRouterChatCompletionsNin", Union[str, float, bool]
1417
1528
  )
1418
1529
 
1419
1530
 
1420
1531
  class CreateChatCompletionOrNinTypedDict(TypedDict):
1421
1532
  r"""Not in"""
1422
1533
 
1423
- nin: List[CreateChatCompletionOrRouterNinTypedDict]
1534
+ nin: List[CreateChatCompletionOrRouterChatCompletionsNinTypedDict]
1424
1535
 
1425
1536
 
1426
1537
  class CreateChatCompletionOrNin(BaseModel):
1427
1538
  r"""Not in"""
1428
1539
 
1429
- nin: List[CreateChatCompletionOrRouterNin]
1540
+ nin: List[CreateChatCompletionOrRouterChatCompletionsNin]
1430
1541
 
1431
1542
 
1432
- CreateChatCompletionOrRouterInTypedDict = TypeAliasType(
1433
- "CreateChatCompletionOrRouterInTypedDict", Union[str, float, bool]
1543
+ CreateChatCompletionOrRouterChatCompletionsInTypedDict = TypeAliasType(
1544
+ "CreateChatCompletionOrRouterChatCompletionsInTypedDict", Union[str, float, bool]
1434
1545
  )
1435
1546
 
1436
1547
 
1437
- CreateChatCompletionOrRouterIn = TypeAliasType(
1438
- "CreateChatCompletionOrRouterIn", Union[str, float, bool]
1548
+ CreateChatCompletionOrRouterChatCompletionsIn = TypeAliasType(
1549
+ "CreateChatCompletionOrRouterChatCompletionsIn", Union[str, float, bool]
1439
1550
  )
1440
1551
 
1441
1552
 
1442
1553
  class CreateChatCompletionOrInTypedDict(TypedDict):
1443
1554
  r"""In"""
1444
1555
 
1445
- in_: List[CreateChatCompletionOrRouterInTypedDict]
1556
+ in_: List[CreateChatCompletionOrRouterChatCompletionsInTypedDict]
1446
1557
 
1447
1558
 
1448
1559
  class CreateChatCompletionOrIn(BaseModel):
1449
1560
  r"""In"""
1450
1561
 
1451
- in_: Annotated[List[CreateChatCompletionOrRouterIn], pydantic.Field(alias="in")]
1562
+ in_: Annotated[
1563
+ List[CreateChatCompletionOrRouterChatCompletionsIn], pydantic.Field(alias="in")
1564
+ ]
1452
1565
 
1453
1566
 
1454
1567
  class CreateChatCompletionOrLteTypedDict(TypedDict):
@@ -1499,52 +1612,52 @@ class CreateChatCompletionOrGt(BaseModel):
1499
1612
  gt: float
1500
1613
 
1501
1614
 
1502
- CreateChatCompletionOrRouterNeTypedDict = TypeAliasType(
1503
- "CreateChatCompletionOrRouterNeTypedDict", Union[str, float, bool]
1615
+ CreateChatCompletionOrRouterChatCompletionsNeTypedDict = TypeAliasType(
1616
+ "CreateChatCompletionOrRouterChatCompletionsNeTypedDict", Union[str, float, bool]
1504
1617
  )
1505
1618
 
1506
1619
 
1507
- CreateChatCompletionOrRouterNe = TypeAliasType(
1508
- "CreateChatCompletionOrRouterNe", Union[str, float, bool]
1620
+ CreateChatCompletionOrRouterChatCompletionsNe = TypeAliasType(
1621
+ "CreateChatCompletionOrRouterChatCompletionsNe", Union[str, float, bool]
1509
1622
  )
1510
1623
 
1511
1624
 
1512
1625
  class CreateChatCompletionOrNeTypedDict(TypedDict):
1513
1626
  r"""Not equal to"""
1514
1627
 
1515
- ne: CreateChatCompletionOrRouterNeTypedDict
1628
+ ne: CreateChatCompletionOrRouterChatCompletionsNeTypedDict
1516
1629
 
1517
1630
 
1518
1631
  class CreateChatCompletionOrNe(BaseModel):
1519
1632
  r"""Not equal to"""
1520
1633
 
1521
- ne: CreateChatCompletionOrRouterNe
1634
+ ne: CreateChatCompletionOrRouterChatCompletionsNe
1522
1635
 
1523
1636
 
1524
- CreateChatCompletionOrRouterEqTypedDict = TypeAliasType(
1525
- "CreateChatCompletionOrRouterEqTypedDict", Union[str, float, bool]
1637
+ CreateChatCompletionOrRouterChatCompletionsEqTypedDict = TypeAliasType(
1638
+ "CreateChatCompletionOrRouterChatCompletionsEqTypedDict", Union[str, float, bool]
1526
1639
  )
1527
1640
 
1528
1641
 
1529
- CreateChatCompletionOrRouterEq = TypeAliasType(
1530
- "CreateChatCompletionOrRouterEq", Union[str, float, bool]
1642
+ CreateChatCompletionOrRouterChatCompletionsEq = TypeAliasType(
1643
+ "CreateChatCompletionOrRouterChatCompletionsEq", Union[str, float, bool]
1531
1644
  )
1532
1645
 
1533
1646
 
1534
1647
  class CreateChatCompletionOrEqTypedDict(TypedDict):
1535
1648
  r"""Equal to"""
1536
1649
 
1537
- eq: CreateChatCompletionOrRouterEqTypedDict
1650
+ eq: CreateChatCompletionOrRouterChatCompletionsEqTypedDict
1538
1651
 
1539
1652
 
1540
1653
  class CreateChatCompletionOrEq(BaseModel):
1541
1654
  r"""Equal to"""
1542
1655
 
1543
- eq: CreateChatCompletionOrRouterEq
1656
+ eq: CreateChatCompletionOrRouterChatCompletionsEq
1544
1657
 
1545
1658
 
1546
- CreateChatCompletionFilterByRouterOrTypedDict = TypeAliasType(
1547
- "CreateChatCompletionFilterByRouterOrTypedDict",
1659
+ CreateChatCompletionFilterByRouterChatCompletionsOrTypedDict = TypeAliasType(
1660
+ "CreateChatCompletionFilterByRouterChatCompletionsOrTypedDict",
1548
1661
  Union[
1549
1662
  CreateChatCompletionOrEqTypedDict,
1550
1663
  CreateChatCompletionOrNeTypedDict,
@@ -1559,8 +1672,8 @@ CreateChatCompletionFilterByRouterOrTypedDict = TypeAliasType(
1559
1672
  )
1560
1673
 
1561
1674
 
1562
- CreateChatCompletionFilterByRouterOr = TypeAliasType(
1563
- "CreateChatCompletionFilterByRouterOr",
1675
+ CreateChatCompletionFilterByRouterChatCompletionsOr = TypeAliasType(
1676
+ "CreateChatCompletionFilterByRouterChatCompletionsOr",
1564
1677
  Union[
1565
1678
  CreateChatCompletionOrEq,
1566
1679
  CreateChatCompletionOrNe,
@@ -1578,14 +1691,14 @@ CreateChatCompletionFilterByRouterOr = TypeAliasType(
1578
1691
  class CreateChatCompletionFilterByOrTypedDict(TypedDict):
1579
1692
  r"""Or"""
1580
1693
 
1581
- or_: List[Dict[str, CreateChatCompletionFilterByRouterOrTypedDict]]
1694
+ or_: List[Dict[str, CreateChatCompletionFilterByRouterChatCompletionsOrTypedDict]]
1582
1695
 
1583
1696
 
1584
1697
  class CreateChatCompletionFilterByOr(BaseModel):
1585
1698
  r"""Or"""
1586
1699
 
1587
1700
  or_: Annotated[
1588
- List[Dict[str, CreateChatCompletionFilterByRouterOr]],
1701
+ List[Dict[str, CreateChatCompletionFilterByRouterChatCompletionsOr]],
1589
1702
  pydantic.Field(alias="or"),
1590
1703
  ]
1591
1704
 
@@ -1602,48 +1715,50 @@ class CreateChatCompletionAndExists(BaseModel):
1602
1715
  exists: bool
1603
1716
 
1604
1717
 
1605
- CreateChatCompletionAndRouterNinTypedDict = TypeAliasType(
1606
- "CreateChatCompletionAndRouterNinTypedDict", Union[str, float, bool]
1718
+ CreateChatCompletionAndRouterChatCompletionsNinTypedDict = TypeAliasType(
1719
+ "CreateChatCompletionAndRouterChatCompletionsNinTypedDict", Union[str, float, bool]
1607
1720
  )
1608
1721
 
1609
1722
 
1610
- CreateChatCompletionAndRouterNin = TypeAliasType(
1611
- "CreateChatCompletionAndRouterNin", Union[str, float, bool]
1723
+ CreateChatCompletionAndRouterChatCompletionsNin = TypeAliasType(
1724
+ "CreateChatCompletionAndRouterChatCompletionsNin", Union[str, float, bool]
1612
1725
  )
1613
1726
 
1614
1727
 
1615
1728
  class CreateChatCompletionAndNinTypedDict(TypedDict):
1616
1729
  r"""Not in"""
1617
1730
 
1618
- nin: List[CreateChatCompletionAndRouterNinTypedDict]
1731
+ nin: List[CreateChatCompletionAndRouterChatCompletionsNinTypedDict]
1619
1732
 
1620
1733
 
1621
1734
  class CreateChatCompletionAndNin(BaseModel):
1622
1735
  r"""Not in"""
1623
1736
 
1624
- nin: List[CreateChatCompletionAndRouterNin]
1737
+ nin: List[CreateChatCompletionAndRouterChatCompletionsNin]
1625
1738
 
1626
1739
 
1627
- CreateChatCompletionAndRouterInTypedDict = TypeAliasType(
1628
- "CreateChatCompletionAndRouterInTypedDict", Union[str, float, bool]
1740
+ CreateChatCompletionAndRouterChatCompletionsInTypedDict = TypeAliasType(
1741
+ "CreateChatCompletionAndRouterChatCompletionsInTypedDict", Union[str, float, bool]
1629
1742
  )
1630
1743
 
1631
1744
 
1632
- CreateChatCompletionAndRouterIn = TypeAliasType(
1633
- "CreateChatCompletionAndRouterIn", Union[str, float, bool]
1745
+ CreateChatCompletionAndRouterChatCompletionsIn = TypeAliasType(
1746
+ "CreateChatCompletionAndRouterChatCompletionsIn", Union[str, float, bool]
1634
1747
  )
1635
1748
 
1636
1749
 
1637
1750
  class CreateChatCompletionAndInTypedDict(TypedDict):
1638
1751
  r"""In"""
1639
1752
 
1640
- in_: List[CreateChatCompletionAndRouterInTypedDict]
1753
+ in_: List[CreateChatCompletionAndRouterChatCompletionsInTypedDict]
1641
1754
 
1642
1755
 
1643
1756
  class CreateChatCompletionAndIn(BaseModel):
1644
1757
  r"""In"""
1645
1758
 
1646
- in_: Annotated[List[CreateChatCompletionAndRouterIn], pydantic.Field(alias="in")]
1759
+ in_: Annotated[
1760
+ List[CreateChatCompletionAndRouterChatCompletionsIn], pydantic.Field(alias="in")
1761
+ ]
1647
1762
 
1648
1763
 
1649
1764
  class CreateChatCompletionAndLteTypedDict(TypedDict):
@@ -1694,52 +1809,52 @@ class CreateChatCompletionAndGt(BaseModel):
1694
1809
  gt: float
1695
1810
 
1696
1811
 
1697
- CreateChatCompletionAndRouterNeTypedDict = TypeAliasType(
1698
- "CreateChatCompletionAndRouterNeTypedDict", Union[str, float, bool]
1812
+ CreateChatCompletionAndRouterChatCompletionsNeTypedDict = TypeAliasType(
1813
+ "CreateChatCompletionAndRouterChatCompletionsNeTypedDict", Union[str, float, bool]
1699
1814
  )
1700
1815
 
1701
1816
 
1702
- CreateChatCompletionAndRouterNe = TypeAliasType(
1703
- "CreateChatCompletionAndRouterNe", Union[str, float, bool]
1817
+ CreateChatCompletionAndRouterChatCompletionsNe = TypeAliasType(
1818
+ "CreateChatCompletionAndRouterChatCompletionsNe", Union[str, float, bool]
1704
1819
  )
1705
1820
 
1706
1821
 
1707
1822
  class CreateChatCompletionAndNeTypedDict(TypedDict):
1708
1823
  r"""Not equal to"""
1709
1824
 
1710
- ne: CreateChatCompletionAndRouterNeTypedDict
1825
+ ne: CreateChatCompletionAndRouterChatCompletionsNeTypedDict
1711
1826
 
1712
1827
 
1713
1828
  class CreateChatCompletionAndNe(BaseModel):
1714
1829
  r"""Not equal to"""
1715
1830
 
1716
- ne: CreateChatCompletionAndRouterNe
1831
+ ne: CreateChatCompletionAndRouterChatCompletionsNe
1717
1832
 
1718
1833
 
1719
- CreateChatCompletionAndRouterEqTypedDict = TypeAliasType(
1720
- "CreateChatCompletionAndRouterEqTypedDict", Union[str, float, bool]
1834
+ CreateChatCompletionAndRouterChatCompletionsEqTypedDict = TypeAliasType(
1835
+ "CreateChatCompletionAndRouterChatCompletionsEqTypedDict", Union[str, float, bool]
1721
1836
  )
1722
1837
 
1723
1838
 
1724
- CreateChatCompletionAndRouterEq = TypeAliasType(
1725
- "CreateChatCompletionAndRouterEq", Union[str, float, bool]
1839
+ CreateChatCompletionAndRouterChatCompletionsEq = TypeAliasType(
1840
+ "CreateChatCompletionAndRouterChatCompletionsEq", Union[str, float, bool]
1726
1841
  )
1727
1842
 
1728
1843
 
1729
1844
  class CreateChatCompletionAndEqTypedDict(TypedDict):
1730
1845
  r"""Equal to"""
1731
1846
 
1732
- eq: CreateChatCompletionAndRouterEqTypedDict
1847
+ eq: CreateChatCompletionAndRouterChatCompletionsEqTypedDict
1733
1848
 
1734
1849
 
1735
1850
  class CreateChatCompletionAndEq(BaseModel):
1736
1851
  r"""Equal to"""
1737
1852
 
1738
- eq: CreateChatCompletionAndRouterEq
1853
+ eq: CreateChatCompletionAndRouterChatCompletionsEq
1739
1854
 
1740
1855
 
1741
- CreateChatCompletionFilterByRouterAndTypedDict = TypeAliasType(
1742
- "CreateChatCompletionFilterByRouterAndTypedDict",
1856
+ CreateChatCompletionFilterByRouterChatCompletionsAndTypedDict = TypeAliasType(
1857
+ "CreateChatCompletionFilterByRouterChatCompletionsAndTypedDict",
1743
1858
  Union[
1744
1859
  CreateChatCompletionAndEqTypedDict,
1745
1860
  CreateChatCompletionAndNeTypedDict,
@@ -1754,8 +1869,8 @@ CreateChatCompletionFilterByRouterAndTypedDict = TypeAliasType(
1754
1869
  )
1755
1870
 
1756
1871
 
1757
- CreateChatCompletionFilterByRouterAnd = TypeAliasType(
1758
- "CreateChatCompletionFilterByRouterAnd",
1872
+ CreateChatCompletionFilterByRouterChatCompletionsAnd = TypeAliasType(
1873
+ "CreateChatCompletionFilterByRouterChatCompletionsAnd",
1759
1874
  Union[
1760
1875
  CreateChatCompletionAndEq,
1761
1876
  CreateChatCompletionAndNe,
@@ -1773,14 +1888,14 @@ CreateChatCompletionFilterByRouterAnd = TypeAliasType(
1773
1888
  class CreateChatCompletionFilterByAndTypedDict(TypedDict):
1774
1889
  r"""And"""
1775
1890
 
1776
- and_: List[Dict[str, CreateChatCompletionFilterByRouterAndTypedDict]]
1891
+ and_: List[Dict[str, CreateChatCompletionFilterByRouterChatCompletionsAndTypedDict]]
1777
1892
 
1778
1893
 
1779
1894
  class CreateChatCompletionFilterByAnd(BaseModel):
1780
1895
  r"""And"""
1781
1896
 
1782
1897
  and_: Annotated[
1783
- List[Dict[str, CreateChatCompletionFilterByRouterAnd]],
1898
+ List[Dict[str, CreateChatCompletionFilterByRouterChatCompletionsAnd]],
1784
1899
  pydantic.Field(alias="and"),
1785
1900
  ]
1786
1901
 
@@ -1797,48 +1912,50 @@ class CreateChatCompletion1Exists(BaseModel):
1797
1912
  exists: bool
1798
1913
 
1799
1914
 
1800
- CreateChatCompletion1RouterNinTypedDict = TypeAliasType(
1801
- "CreateChatCompletion1RouterNinTypedDict", Union[str, float, bool]
1915
+ CreateChatCompletion1RouterChatCompletionsNinTypedDict = TypeAliasType(
1916
+ "CreateChatCompletion1RouterChatCompletionsNinTypedDict", Union[str, float, bool]
1802
1917
  )
1803
1918
 
1804
1919
 
1805
- CreateChatCompletion1RouterNin = TypeAliasType(
1806
- "CreateChatCompletion1RouterNin", Union[str, float, bool]
1920
+ CreateChatCompletion1RouterChatCompletionsNin = TypeAliasType(
1921
+ "CreateChatCompletion1RouterChatCompletionsNin", Union[str, float, bool]
1807
1922
  )
1808
1923
 
1809
1924
 
1810
1925
  class CreateChatCompletion1NinTypedDict(TypedDict):
1811
1926
  r"""Not in"""
1812
1927
 
1813
- nin: List[CreateChatCompletion1RouterNinTypedDict]
1928
+ nin: List[CreateChatCompletion1RouterChatCompletionsNinTypedDict]
1814
1929
 
1815
1930
 
1816
1931
  class CreateChatCompletion1Nin(BaseModel):
1817
1932
  r"""Not in"""
1818
1933
 
1819
- nin: List[CreateChatCompletion1RouterNin]
1934
+ nin: List[CreateChatCompletion1RouterChatCompletionsNin]
1820
1935
 
1821
1936
 
1822
- CreateChatCompletion1RouterInTypedDict = TypeAliasType(
1823
- "CreateChatCompletion1RouterInTypedDict", Union[str, float, bool]
1937
+ CreateChatCompletion1RouterChatCompletionsInTypedDict = TypeAliasType(
1938
+ "CreateChatCompletion1RouterChatCompletionsInTypedDict", Union[str, float, bool]
1824
1939
  )
1825
1940
 
1826
1941
 
1827
- CreateChatCompletion1RouterIn = TypeAliasType(
1828
- "CreateChatCompletion1RouterIn", Union[str, float, bool]
1942
+ CreateChatCompletion1RouterChatCompletionsIn = TypeAliasType(
1943
+ "CreateChatCompletion1RouterChatCompletionsIn", Union[str, float, bool]
1829
1944
  )
1830
1945
 
1831
1946
 
1832
1947
  class CreateChatCompletion1InTypedDict(TypedDict):
1833
1948
  r"""In"""
1834
1949
 
1835
- in_: List[CreateChatCompletion1RouterInTypedDict]
1950
+ in_: List[CreateChatCompletion1RouterChatCompletionsInTypedDict]
1836
1951
 
1837
1952
 
1838
1953
  class CreateChatCompletion1In(BaseModel):
1839
1954
  r"""In"""
1840
1955
 
1841
- in_: Annotated[List[CreateChatCompletion1RouterIn], pydantic.Field(alias="in")]
1956
+ in_: Annotated[
1957
+ List[CreateChatCompletion1RouterChatCompletionsIn], pydantic.Field(alias="in")
1958
+ ]
1842
1959
 
1843
1960
 
1844
1961
  class CreateChatCompletion1LteTypedDict(TypedDict):
@@ -1889,48 +2006,48 @@ class CreateChatCompletion1Gt(BaseModel):
1889
2006
  gt: float
1890
2007
 
1891
2008
 
1892
- CreateChatCompletion1RouterNeTypedDict = TypeAliasType(
1893
- "CreateChatCompletion1RouterNeTypedDict", Union[str, float, bool]
2009
+ CreateChatCompletion1RouterChatCompletionsNeTypedDict = TypeAliasType(
2010
+ "CreateChatCompletion1RouterChatCompletionsNeTypedDict", Union[str, float, bool]
1894
2011
  )
1895
2012
 
1896
2013
 
1897
- CreateChatCompletion1RouterNe = TypeAliasType(
1898
- "CreateChatCompletion1RouterNe", Union[str, float, bool]
2014
+ CreateChatCompletion1RouterChatCompletionsNe = TypeAliasType(
2015
+ "CreateChatCompletion1RouterChatCompletionsNe", Union[str, float, bool]
1899
2016
  )
1900
2017
 
1901
2018
 
1902
2019
  class CreateChatCompletion1NeTypedDict(TypedDict):
1903
2020
  r"""Not equal to"""
1904
2021
 
1905
- ne: CreateChatCompletion1RouterNeTypedDict
2022
+ ne: CreateChatCompletion1RouterChatCompletionsNeTypedDict
1906
2023
 
1907
2024
 
1908
2025
  class CreateChatCompletion1Ne(BaseModel):
1909
2026
  r"""Not equal to"""
1910
2027
 
1911
- ne: CreateChatCompletion1RouterNe
2028
+ ne: CreateChatCompletion1RouterChatCompletionsNe
1912
2029
 
1913
2030
 
1914
- CreateChatCompletion1RouterEqTypedDict = TypeAliasType(
1915
- "CreateChatCompletion1RouterEqTypedDict", Union[str, float, bool]
2031
+ CreateChatCompletion1RouterChatCompletionsEqTypedDict = TypeAliasType(
2032
+ "CreateChatCompletion1RouterChatCompletionsEqTypedDict", Union[str, float, bool]
1916
2033
  )
1917
2034
 
1918
2035
 
1919
- CreateChatCompletion1RouterEq = TypeAliasType(
1920
- "CreateChatCompletion1RouterEq", Union[str, float, bool]
2036
+ CreateChatCompletion1RouterChatCompletionsEq = TypeAliasType(
2037
+ "CreateChatCompletion1RouterChatCompletionsEq", Union[str, float, bool]
1921
2038
  )
1922
2039
 
1923
2040
 
1924
2041
  class CreateChatCompletion1EqTypedDict(TypedDict):
1925
2042
  r"""Equal to"""
1926
2043
 
1927
- eq: CreateChatCompletion1RouterEqTypedDict
2044
+ eq: CreateChatCompletion1RouterChatCompletionsEqTypedDict
1928
2045
 
1929
2046
 
1930
2047
  class CreateChatCompletion1Eq(BaseModel):
1931
2048
  r"""Equal to"""
1932
2049
 
1933
- eq: CreateChatCompletion1RouterEq
2050
+ eq: CreateChatCompletion1RouterChatCompletionsEq
1934
2051
 
1935
2052
 
1936
2053
  CreateChatCompletionFilterBy1TypedDict = TypeAliasType(
@@ -2158,20 +2275,17 @@ class CreateChatCompletionKnowledgeBases(BaseModel):
2158
2275
  return m
2159
2276
 
2160
2277
 
2161
- LoadBalancerType = Literal["weight_based",]
2278
+ CreateChatCompletionLoadBalancerRouterChatCompletionsType = Literal["weight_based",]
2162
2279
 
2163
2280
 
2164
- class LoadBalancer1TypedDict(TypedDict):
2165
- type: LoadBalancerType
2281
+ class CreateChatCompletionLoadBalancerRouterChatCompletionsModelsTypedDict(TypedDict):
2166
2282
  model: str
2167
2283
  r"""Model identifier for load balancing"""
2168
2284
  weight: NotRequired[float]
2169
2285
  r"""Weight assigned to this model for load balancing"""
2170
2286
 
2171
2287
 
2172
- class LoadBalancer1(BaseModel):
2173
- type: LoadBalancerType
2174
-
2288
+ class CreateChatCompletionLoadBalancerRouterChatCompletionsModels(BaseModel):
2175
2289
  model: str
2176
2290
  r"""Model identifier for load balancing"""
2177
2291
 
@@ -2195,72 +2309,106 @@ class LoadBalancer1(BaseModel):
2195
2309
  return m
2196
2310
 
2197
2311
 
2198
- LoadBalancerTypedDict = LoadBalancer1TypedDict
2312
+ class CreateChatCompletionLoadBalancerRouterChatCompletions1TypedDict(TypedDict):
2313
+ type: CreateChatCompletionLoadBalancerRouterChatCompletionsType
2314
+ models: List[CreateChatCompletionLoadBalancerRouterChatCompletionsModelsTypedDict]
2315
+
2199
2316
 
2317
+ class CreateChatCompletionLoadBalancerRouterChatCompletions1(BaseModel):
2318
+ type: CreateChatCompletionLoadBalancerRouterChatCompletionsType
2200
2319
 
2201
- LoadBalancer = LoadBalancer1
2320
+ models: List[CreateChatCompletionLoadBalancerRouterChatCompletionsModels]
2321
+
2322
+
2323
+ CreateChatCompletionRouterChatCompletionsLoadBalancerTypedDict = (
2324
+ CreateChatCompletionLoadBalancerRouterChatCompletions1TypedDict
2325
+ )
2326
+ r"""Array of models with weights for load balancing requests"""
2202
2327
 
2203
2328
 
2204
- class TimeoutTypedDict(TypedDict):
2329
+ CreateChatCompletionRouterChatCompletionsLoadBalancer = (
2330
+ CreateChatCompletionLoadBalancerRouterChatCompletions1
2331
+ )
2332
+ r"""Array of models with weights for load balancing requests"""
2333
+
2334
+
2335
+ class CreateChatCompletionRouterChatCompletionsTimeoutTypedDict(TypedDict):
2205
2336
  r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
2206
2337
 
2207
2338
  call_timeout: float
2208
2339
  r"""Timeout value in milliseconds"""
2209
2340
 
2210
2341
 
2211
- class Timeout(BaseModel):
2342
+ class CreateChatCompletionRouterChatCompletionsTimeout(BaseModel):
2212
2343
  r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
2213
2344
 
2214
2345
  call_timeout: float
2215
2346
  r"""Timeout value in milliseconds"""
2216
2347
 
2217
2348
 
2349
+ @deprecated(
2350
+ "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
2351
+ )
2218
2352
  class CreateChatCompletionOrqTypedDict(TypedDict):
2219
2353
  r"""Leverage Orq's intelligent routing capabilities to enhance your AI application with enterprise-grade reliability and observability. Orq provides automatic request management including retries on failures, model fallbacks for high availability, identity-level analytics tracking, conversation threading, and dynamic prompt templating with variable substitution."""
2220
2354
 
2221
2355
  name: NotRequired[str]
2222
2356
  r"""The name to display on the trace. If not specified, the default system name will be used."""
2223
- retry: NotRequired[CreateChatCompletionRetryTypedDict]
2357
+ retry: NotRequired[CreateChatCompletionRouterChatCompletionsRetryTypedDict]
2224
2358
  r"""Retry configuration for the request"""
2225
- fallbacks: NotRequired[List[FallbacksTypedDict]]
2359
+ fallbacks: NotRequired[
2360
+ List[CreateChatCompletionRouterChatCompletionsFallbacksTypedDict]
2361
+ ]
2226
2362
  r"""Array of fallback models to use if primary model fails"""
2227
2363
  prompt: NotRequired[PromptTypedDict]
2228
2364
  r"""Prompt configuration for the request"""
2229
- identity: NotRequired[PublicContactTypedDict]
2365
+ identity: NotRequired[PublicIdentityTypedDict]
2230
2366
  r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
2231
- contact: NotRequired[CreateChatCompletionContactTypedDict]
2367
+ contact: NotRequired[PublicContactTypedDict]
2368
+ r"""@deprecated Use identity instead. Information about the contact making the request."""
2232
2369
  thread: NotRequired[CreateChatCompletionThreadTypedDict]
2233
2370
  r"""Thread information to group related requests"""
2234
2371
  inputs: NotRequired[InputsTypedDict]
2235
2372
  r"""Values to replace in the prompt messages using {{variableName}} syntax"""
2236
- cache: NotRequired[CacheTypedDict]
2373
+ cache: NotRequired[CreateChatCompletionRouterChatCompletionsCacheTypedDict]
2237
2374
  r"""Cache configuration for the request."""
2238
2375
  knowledge_bases: NotRequired[List[CreateChatCompletionKnowledgeBasesTypedDict]]
2239
- load_balancer: NotRequired[List[LoadBalancerTypedDict]]
2376
+ load_balancer: NotRequired[
2377
+ CreateChatCompletionRouterChatCompletionsLoadBalancerTypedDict
2378
+ ]
2240
2379
  r"""Array of models with weights for load balancing requests"""
2241
- timeout: NotRequired[TimeoutTypedDict]
2380
+ timeout: NotRequired[CreateChatCompletionRouterChatCompletionsTimeoutTypedDict]
2242
2381
  r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
2243
2382
 
2244
2383
 
2384
+ @deprecated(
2385
+ "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
2386
+ )
2245
2387
  class CreateChatCompletionOrq(BaseModel):
2246
2388
  r"""Leverage Orq's intelligent routing capabilities to enhance your AI application with enterprise-grade reliability and observability. Orq provides automatic request management including retries on failures, model fallbacks for high availability, identity-level analytics tracking, conversation threading, and dynamic prompt templating with variable substitution."""
2247
2389
 
2248
2390
  name: Optional[str] = None
2249
2391
  r"""The name to display on the trace. If not specified, the default system name will be used."""
2250
2392
 
2251
- retry: Optional[CreateChatCompletionRetry] = None
2393
+ retry: Optional[CreateChatCompletionRouterChatCompletionsRetry] = None
2252
2394
  r"""Retry configuration for the request"""
2253
2395
 
2254
- fallbacks: Optional[List[Fallbacks]] = None
2396
+ fallbacks: Optional[List[CreateChatCompletionRouterChatCompletionsFallbacks]] = None
2255
2397
  r"""Array of fallback models to use if primary model fails"""
2256
2398
 
2257
2399
  prompt: Optional[Prompt] = None
2258
2400
  r"""Prompt configuration for the request"""
2259
2401
 
2260
- identity: Optional[PublicContact] = None
2402
+ identity: Optional[PublicIdentity] = None
2261
2403
  r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
2262
2404
 
2263
- contact: Optional[CreateChatCompletionContact] = None
2405
+ contact: Annotated[
2406
+ Optional[PublicContact],
2407
+ pydantic.Field(
2408
+ deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
2409
+ ),
2410
+ ] = None
2411
+ r"""@deprecated Use identity instead. Information about the contact making the request."""
2264
2412
 
2265
2413
  thread: Optional[CreateChatCompletionThread] = None
2266
2414
  r"""Thread information to group related requests"""
@@ -2268,15 +2416,17 @@ class CreateChatCompletionOrq(BaseModel):
2268
2416
  inputs: Optional[Inputs] = None
2269
2417
  r"""Values to replace in the prompt messages using {{variableName}} syntax"""
2270
2418
 
2271
- cache: Optional[Cache] = None
2419
+ cache: Optional[CreateChatCompletionRouterChatCompletionsCache] = None
2272
2420
  r"""Cache configuration for the request."""
2273
2421
 
2274
2422
  knowledge_bases: Optional[List[CreateChatCompletionKnowledgeBases]] = None
2275
2423
 
2276
- load_balancer: Optional[List[LoadBalancer]] = None
2424
+ load_balancer: Optional[CreateChatCompletionRouterChatCompletionsLoadBalancer] = (
2425
+ None
2426
+ )
2277
2427
  r"""Array of models with weights for load balancing requests"""
2278
2428
 
2279
- timeout: Optional[Timeout] = None
2429
+ timeout: Optional[CreateChatCompletionRouterChatCompletionsTimeout] = None
2280
2430
  r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
2281
2431
 
2282
2432
  @model_serializer(mode="wrap")
@@ -2318,6 +2468,8 @@ class CreateChatCompletionRequestBodyTypedDict(TypedDict):
2318
2468
  r"""Model ID used to generate the response, like `openai/gpt-4o` or `anthropic/claude-haiku-4-5-20251001`. The AI Gateway offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the (Supported models)[/docs/proxy/supported-models] to browse available models."""
2319
2469
  metadata: NotRequired[Dict[str, str]]
2320
2470
  r"""Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can have a maximum length of 64 characters and values can have a maximum length of 512 characters."""
2471
+ name: NotRequired[str]
2472
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
2321
2473
  audio: NotRequired[Nullable[CreateChatCompletionAudioTypedDict]]
2322
2474
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
2323
2475
  frequency_penalty: NotRequired[Nullable[float]]
@@ -2374,6 +2526,16 @@ class CreateChatCompletionRequestBodyTypedDict(TypedDict):
2374
2526
  r"""Output types that you would like the model to generate. Most models are capable of generating text, which is the default: [\"text\"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: [\"text\", \"audio\"]."""
2375
2527
  guardrails: NotRequired[List[CreateChatCompletionGuardrailsTypedDict]]
2376
2528
  r"""A list of guardrails to apply to the request."""
2529
+ fallbacks: NotRequired[List[CreateChatCompletionFallbacksTypedDict]]
2530
+ r"""Array of fallback models to use if primary model fails"""
2531
+ retry: NotRequired[CreateChatCompletionRetryTypedDict]
2532
+ r"""Retry configuration for the request"""
2533
+ cache: NotRequired[CreateChatCompletionCacheTypedDict]
2534
+ r"""Cache configuration for the request."""
2535
+ load_balancer: NotRequired[CreateChatCompletionLoadBalancerTypedDict]
2536
+ r"""Load balancer configuration for the request."""
2537
+ timeout: NotRequired[CreateChatCompletionTimeoutTypedDict]
2538
+ r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
2377
2539
  orq: NotRequired[CreateChatCompletionOrqTypedDict]
2378
2540
  r"""Leverage Orq's intelligent routing capabilities to enhance your AI application with enterprise-grade reliability and observability. Orq provides automatic request management including retries on failures, model fallbacks for high availability, identity-level analytics tracking, conversation threading, and dynamic prompt templating with variable substitution."""
2379
2541
  stream: NotRequired[bool]
@@ -2389,6 +2551,9 @@ class CreateChatCompletionRequestBody(BaseModel):
2389
2551
  metadata: Optional[Dict[str, str]] = None
2390
2552
  r"""Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can have a maximum length of 64 characters and values can have a maximum length of 512 characters."""
2391
2553
 
2554
+ name: Optional[str] = None
2555
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
2556
+
2392
2557
  audio: OptionalNullable[CreateChatCompletionAudio] = UNSET
2393
2558
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
2394
2559
 
@@ -2468,7 +2633,27 @@ class CreateChatCompletionRequestBody(BaseModel):
2468
2633
  guardrails: Optional[List[CreateChatCompletionGuardrails]] = None
2469
2634
  r"""A list of guardrails to apply to the request."""
2470
2635
 
2471
- orq: Optional[CreateChatCompletionOrq] = None
2636
+ fallbacks: Optional[List[CreateChatCompletionFallbacks]] = None
2637
+ r"""Array of fallback models to use if primary model fails"""
2638
+
2639
+ retry: Optional[CreateChatCompletionRetry] = None
2640
+ r"""Retry configuration for the request"""
2641
+
2642
+ cache: Optional[CreateChatCompletionCache] = None
2643
+ r"""Cache configuration for the request."""
2644
+
2645
+ load_balancer: Optional[CreateChatCompletionLoadBalancer] = None
2646
+ r"""Load balancer configuration for the request."""
2647
+
2648
+ timeout: Optional[CreateChatCompletionTimeout] = None
2649
+ r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
2650
+
2651
+ orq: Annotated[
2652
+ Optional[CreateChatCompletionOrq],
2653
+ pydantic.Field(
2654
+ deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
2655
+ ),
2656
+ ] = None
2472
2657
  r"""Leverage Orq's intelligent routing capabilities to enhance your AI application with enterprise-grade reliability and observability. Orq provides automatic request management including retries on failures, model fallbacks for high availability, identity-level analytics tracking, conversation threading, and dynamic prompt templating with variable substitution."""
2473
2658
 
2474
2659
  stream: Optional[bool] = False
@@ -2478,6 +2663,7 @@ class CreateChatCompletionRequestBody(BaseModel):
2478
2663
  optional_fields = set(
2479
2664
  [
2480
2665
  "metadata",
2666
+ "name",
2481
2667
  "audio",
2482
2668
  "frequency_penalty",
2483
2669
  "max_tokens",
@@ -2501,6 +2687,11 @@ class CreateChatCompletionRequestBody(BaseModel):
2501
2687
  "parallel_tool_calls",
2502
2688
  "modalities",
2503
2689
  "guardrails",
2690
+ "fallbacks",
2691
+ "retry",
2692
+ "cache",
2693
+ "load_balancer",
2694
+ "timeout",
2504
2695
  "orq",
2505
2696
  "stream",
2506
2697
  ]
@@ -2546,7 +2737,7 @@ class CreateChatCompletionRequestBody(BaseModel):
2546
2737
  return m
2547
2738
 
2548
2739
 
2549
- CreateChatCompletionRouterFinishReason = Literal[
2740
+ CreateChatCompletionRouterChatCompletionsFinishReason = Literal[
2550
2741
  "stop",
2551
2742
  "length",
2552
2743
  "tool_calls",
@@ -2556,7 +2747,7 @@ CreateChatCompletionRouterFinishReason = Literal[
2556
2747
  r"""The reason the model stopped generating tokens."""
2557
2748
 
2558
2749
 
2559
- class CreateChatCompletionRouterResponseTopLogprobsTypedDict(TypedDict):
2750
+ class CreateChatCompletionRouterChatCompletionsResponseTopLogprobsTypedDict(TypedDict):
2560
2751
  token: str
2561
2752
  r"""The token."""
2562
2753
  logprob: float
@@ -2565,7 +2756,7 @@ class CreateChatCompletionRouterResponseTopLogprobsTypedDict(TypedDict):
2565
2756
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
2566
2757
 
2567
2758
 
2568
- class CreateChatCompletionRouterResponseTopLogprobs(BaseModel):
2759
+ class CreateChatCompletionRouterChatCompletionsResponseTopLogprobs(BaseModel):
2569
2760
  token: str
2570
2761
  r"""The token."""
2571
2762
 
@@ -2590,18 +2781,20 @@ class CreateChatCompletionRouterResponseTopLogprobs(BaseModel):
2590
2781
  return m
2591
2782
 
2592
2783
 
2593
- class CreateChatCompletionRouterContentTypedDict(TypedDict):
2784
+ class CreateChatCompletionRouterChatCompletionsContentTypedDict(TypedDict):
2594
2785
  token: str
2595
2786
  r"""The token."""
2596
2787
  logprob: float
2597
2788
  r"""The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."""
2598
2789
  bytes_: Nullable[List[float]]
2599
2790
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
2600
- top_logprobs: List[CreateChatCompletionRouterResponseTopLogprobsTypedDict]
2791
+ top_logprobs: List[
2792
+ CreateChatCompletionRouterChatCompletionsResponseTopLogprobsTypedDict
2793
+ ]
2601
2794
  r"""List of the most likely tokens and their log probability, at this token position."""
2602
2795
 
2603
2796
 
2604
- class CreateChatCompletionRouterContent(BaseModel):
2797
+ class CreateChatCompletionRouterChatCompletionsContent(BaseModel):
2605
2798
  token: str
2606
2799
  r"""The token."""
2607
2800
 
@@ -2611,7 +2804,7 @@ class CreateChatCompletionRouterContent(BaseModel):
2611
2804
  bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
2612
2805
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
2613
2806
 
2614
- top_logprobs: List[CreateChatCompletionRouterResponseTopLogprobs]
2807
+ top_logprobs: List[CreateChatCompletionRouterChatCompletionsResponseTopLogprobs]
2615
2808
  r"""List of the most likely tokens and their log probability, at this token position."""
2616
2809
 
2617
2810
  @model_serializer(mode="wrap")
@@ -2629,7 +2822,9 @@ class CreateChatCompletionRouterContent(BaseModel):
2629
2822
  return m
2630
2823
 
2631
2824
 
2632
- class CreateChatCompletionRouterResponse200TopLogprobsTypedDict(TypedDict):
2825
+ class CreateChatCompletionRouterChatCompletionsResponse200TopLogprobsTypedDict(
2826
+ TypedDict
2827
+ ):
2633
2828
  token: str
2634
2829
  r"""The token."""
2635
2830
  logprob: float
@@ -2638,7 +2833,7 @@ class CreateChatCompletionRouterResponse200TopLogprobsTypedDict(TypedDict):
2638
2833
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
2639
2834
 
2640
2835
 
2641
- class CreateChatCompletionRouterResponse200TopLogprobs(BaseModel):
2836
+ class CreateChatCompletionRouterChatCompletionsResponse200TopLogprobs(BaseModel):
2642
2837
  token: str
2643
2838
  r"""The token."""
2644
2839
 
@@ -2663,18 +2858,20 @@ class CreateChatCompletionRouterResponse200TopLogprobs(BaseModel):
2663
2858
  return m
2664
2859
 
2665
2860
 
2666
- class CreateChatCompletionRouterRefusalTypedDict(TypedDict):
2861
+ class CreateChatCompletionRouterChatCompletionsRefusalTypedDict(TypedDict):
2667
2862
  token: str
2668
2863
  r"""The token."""
2669
2864
  logprob: float
2670
2865
  r"""The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."""
2671
2866
  bytes_: Nullable[List[float]]
2672
2867
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
2673
- top_logprobs: List[CreateChatCompletionRouterResponse200TopLogprobsTypedDict]
2868
+ top_logprobs: List[
2869
+ CreateChatCompletionRouterChatCompletionsResponse200TopLogprobsTypedDict
2870
+ ]
2674
2871
  r"""List of the most likely tokens and their log probability, at this token position."""
2675
2872
 
2676
2873
 
2677
- class CreateChatCompletionRouterRefusal(BaseModel):
2874
+ class CreateChatCompletionRouterChatCompletionsRefusal(BaseModel):
2678
2875
  token: str
2679
2876
  r"""The token."""
2680
2877
 
@@ -2684,7 +2881,7 @@ class CreateChatCompletionRouterRefusal(BaseModel):
2684
2881
  bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
2685
2882
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
2686
2883
 
2687
- top_logprobs: List[CreateChatCompletionRouterResponse200TopLogprobs]
2884
+ top_logprobs: List[CreateChatCompletionRouterChatCompletionsResponse200TopLogprobs]
2688
2885
  r"""List of the most likely tokens and their log probability, at this token position."""
2689
2886
 
2690
2887
  @model_serializer(mode="wrap")
@@ -2702,22 +2899,22 @@ class CreateChatCompletionRouterRefusal(BaseModel):
2702
2899
  return m
2703
2900
 
2704
2901
 
2705
- class CreateChatCompletionRouterLogprobsTypedDict(TypedDict):
2902
+ class CreateChatCompletionRouterChatCompletionsLogprobsTypedDict(TypedDict):
2706
2903
  r"""Log probability information for the choice."""
2707
2904
 
2708
- content: Nullable[List[CreateChatCompletionRouterContentTypedDict]]
2905
+ content: Nullable[List[CreateChatCompletionRouterChatCompletionsContentTypedDict]]
2709
2906
  r"""A list of message content tokens with log probability information."""
2710
- refusal: Nullable[List[CreateChatCompletionRouterRefusalTypedDict]]
2907
+ refusal: Nullable[List[CreateChatCompletionRouterChatCompletionsRefusalTypedDict]]
2711
2908
  r"""A list of message refusal tokens with log probability information."""
2712
2909
 
2713
2910
 
2714
- class CreateChatCompletionRouterLogprobs(BaseModel):
2911
+ class CreateChatCompletionRouterChatCompletionsLogprobs(BaseModel):
2715
2912
  r"""Log probability information for the choice."""
2716
2913
 
2717
- content: Nullable[List[CreateChatCompletionRouterContent]]
2914
+ content: Nullable[List[CreateChatCompletionRouterChatCompletionsContent]]
2718
2915
  r"""A list of message content tokens with log probability information."""
2719
2916
 
2720
- refusal: Nullable[List[CreateChatCompletionRouterRefusal]]
2917
+ refusal: Nullable[List[CreateChatCompletionRouterChatCompletionsRefusal]]
2721
2918
  r"""A list of message refusal tokens with log probability information."""
2722
2919
 
2723
2920
  @model_serializer(mode="wrap")
@@ -2735,18 +2932,18 @@ class CreateChatCompletionRouterLogprobs(BaseModel):
2735
2932
  return m
2736
2933
 
2737
2934
 
2738
- CreateChatCompletionRouterResponse200Type = Literal["function",]
2935
+ CreateChatCompletionRouterChatCompletionsResponse200Type = Literal["function",]
2739
2936
  r"""The type of the tool. Currently, only `function` is supported."""
2740
2937
 
2741
2938
 
2742
- class CreateChatCompletionRouterResponseFunctionTypedDict(TypedDict):
2939
+ class CreateChatCompletionRouterChatCompletionsResponseFunctionTypedDict(TypedDict):
2743
2940
  name: NotRequired[str]
2744
2941
  r"""The name of the function."""
2745
2942
  arguments: NotRequired[str]
2746
2943
  r"""The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."""
2747
2944
 
2748
2945
 
2749
- class CreateChatCompletionRouterResponseFunction(BaseModel):
2946
+ class CreateChatCompletionRouterChatCompletionsResponseFunction(BaseModel):
2750
2947
  name: Optional[str] = None
2751
2948
  r"""The name of the function."""
2752
2949
 
@@ -2770,29 +2967,31 @@ class CreateChatCompletionRouterResponseFunction(BaseModel):
2770
2967
  return m
2771
2968
 
2772
2969
 
2773
- class CreateChatCompletionRouterToolCallsTypedDict(TypedDict):
2970
+ class CreateChatCompletionRouterChatCompletionsToolCallsTypedDict(TypedDict):
2774
2971
  index: NotRequired[float]
2775
2972
  r"""The index of the tool call."""
2776
2973
  id: NotRequired[str]
2777
2974
  r"""The ID of the tool call."""
2778
- type: NotRequired[CreateChatCompletionRouterResponse200Type]
2975
+ type: NotRequired[CreateChatCompletionRouterChatCompletionsResponse200Type]
2779
2976
  r"""The type of the tool. Currently, only `function` is supported."""
2780
- function: NotRequired[CreateChatCompletionRouterResponseFunctionTypedDict]
2977
+ function: NotRequired[
2978
+ CreateChatCompletionRouterChatCompletionsResponseFunctionTypedDict
2979
+ ]
2781
2980
  thought_signature: NotRequired[str]
2782
2981
  r"""Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models."""
2783
2982
 
2784
2983
 
2785
- class CreateChatCompletionRouterToolCalls(BaseModel):
2984
+ class CreateChatCompletionRouterChatCompletionsToolCalls(BaseModel):
2786
2985
  index: Optional[float] = None
2787
2986
  r"""The index of the tool call."""
2788
2987
 
2789
2988
  id: Optional[str] = None
2790
2989
  r"""The ID of the tool call."""
2791
2990
 
2792
- type: Optional[CreateChatCompletionRouterResponse200Type] = None
2991
+ type: Optional[CreateChatCompletionRouterChatCompletionsResponse200Type] = None
2793
2992
  r"""The type of the tool. Currently, only `function` is supported."""
2794
2993
 
2795
- function: Optional[CreateChatCompletionRouterResponseFunction] = None
2994
+ function: Optional[CreateChatCompletionRouterChatCompletionsResponseFunction] = None
2796
2995
 
2797
2996
  thought_signature: Optional[str] = None
2798
2997
  r"""Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models."""
@@ -2814,10 +3013,10 @@ class CreateChatCompletionRouterToolCalls(BaseModel):
2814
3013
  return m
2815
3014
 
2816
3015
 
2817
- CreateChatCompletionRouterRole = Literal["assistant",]
3016
+ CreateChatCompletionRouterChatCompletionsRole = Literal["assistant",]
2818
3017
 
2819
3018
 
2820
- class CreateChatCompletionRouterResponseAudioTypedDict(TypedDict):
3019
+ class CreateChatCompletionRouterChatCompletionsResponseAudioTypedDict(TypedDict):
2821
3020
  r"""Audio response data in streaming mode."""
2822
3021
 
2823
3022
  id: NotRequired[str]
@@ -2826,7 +3025,7 @@ class CreateChatCompletionRouterResponseAudioTypedDict(TypedDict):
2826
3025
  expires_at: NotRequired[int]
2827
3026
 
2828
3027
 
2829
- class CreateChatCompletionRouterResponseAudio(BaseModel):
3028
+ class CreateChatCompletionRouterChatCompletionsResponseAudio(BaseModel):
2830
3029
  r"""Audio response data in streaming mode."""
2831
3030
 
2832
3031
  id: Optional[str] = None
@@ -2860,15 +3059,19 @@ class DeltaTypedDict(TypedDict):
2860
3059
  content: NotRequired[Nullable[str]]
2861
3060
  r"""The contents of the chunk message."""
2862
3061
  refusal: NotRequired[Nullable[str]]
2863
- tool_calls: NotRequired[List[CreateChatCompletionRouterToolCallsTypedDict]]
2864
- role: NotRequired[CreateChatCompletionRouterRole]
3062
+ tool_calls: NotRequired[
3063
+ List[CreateChatCompletionRouterChatCompletionsToolCallsTypedDict]
3064
+ ]
3065
+ role: NotRequired[CreateChatCompletionRouterChatCompletionsRole]
2865
3066
  reasoning: NotRequired[str]
2866
3067
  r"""Internal thought process of the model"""
2867
3068
  reasoning_signature: NotRequired[str]
2868
3069
  r"""The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`."""
2869
3070
  redacted_reasoning: NotRequired[str]
2870
3071
  r"""Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context."""
2871
- audio: NotRequired[Nullable[CreateChatCompletionRouterResponseAudioTypedDict]]
3072
+ audio: NotRequired[
3073
+ Nullable[CreateChatCompletionRouterChatCompletionsResponseAudioTypedDict]
3074
+ ]
2872
3075
  r"""Audio response data in streaming mode."""
2873
3076
 
2874
3077
 
@@ -2880,9 +3083,11 @@ class Delta(BaseModel):
2880
3083
 
2881
3084
  refusal: OptionalNullable[str] = UNSET
2882
3085
 
2883
- tool_calls: Optional[List[CreateChatCompletionRouterToolCalls]] = None
3086
+ tool_calls: Optional[List[CreateChatCompletionRouterChatCompletionsToolCalls]] = (
3087
+ None
3088
+ )
2884
3089
 
2885
- role: Optional[CreateChatCompletionRouterRole] = None
3090
+ role: Optional[CreateChatCompletionRouterChatCompletionsRole] = None
2886
3091
 
2887
3092
  reasoning: Optional[str] = None
2888
3093
  r"""Internal thought process of the model"""
@@ -2893,7 +3098,9 @@ class Delta(BaseModel):
2893
3098
  redacted_reasoning: Optional[str] = None
2894
3099
  r"""Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context."""
2895
3100
 
2896
- audio: OptionalNullable[CreateChatCompletionRouterResponseAudio] = UNSET
3101
+ audio: OptionalNullable[CreateChatCompletionRouterChatCompletionsResponseAudio] = (
3102
+ UNSET
3103
+ )
2897
3104
  r"""Audio response data in streaming mode."""
2898
3105
 
2899
3106
  @model_serializer(mode="wrap")
@@ -2933,19 +3140,21 @@ class Delta(BaseModel):
2933
3140
  return m
2934
3141
 
2935
3142
 
2936
- class CreateChatCompletionRouterChoicesTypedDict(TypedDict):
2937
- finish_reason: Nullable[CreateChatCompletionRouterFinishReason]
3143
+ class CreateChatCompletionRouterChatCompletionsChoicesTypedDict(TypedDict):
3144
+ finish_reason: Nullable[CreateChatCompletionRouterChatCompletionsFinishReason]
2938
3145
  r"""The reason the model stopped generating tokens."""
2939
3146
  delta: DeltaTypedDict
2940
3147
  r"""A chat completion delta generated by streamed model responses."""
2941
3148
  index: NotRequired[float]
2942
3149
  r"""The index of the choice in the list of choices."""
2943
- logprobs: NotRequired[Nullable[CreateChatCompletionRouterLogprobsTypedDict]]
3150
+ logprobs: NotRequired[
3151
+ Nullable[CreateChatCompletionRouterChatCompletionsLogprobsTypedDict]
3152
+ ]
2944
3153
  r"""Log probability information for the choice."""
2945
3154
 
2946
3155
 
2947
- class CreateChatCompletionRouterChoices(BaseModel):
2948
- finish_reason: Nullable[CreateChatCompletionRouterFinishReason]
3156
+ class CreateChatCompletionRouterChatCompletionsChoices(BaseModel):
3157
+ finish_reason: Nullable[CreateChatCompletionRouterChatCompletionsFinishReason]
2949
3158
  r"""The reason the model stopped generating tokens."""
2950
3159
 
2951
3160
  delta: Delta
@@ -2954,7 +3163,9 @@ class CreateChatCompletionRouterChoices(BaseModel):
2954
3163
  index: Optional[float] = 0
2955
3164
  r"""The index of the choice in the list of choices."""
2956
3165
 
2957
- logprobs: OptionalNullable[CreateChatCompletionRouterLogprobs] = UNSET
3166
+ logprobs: OptionalNullable[CreateChatCompletionRouterChatCompletionsLogprobs] = (
3167
+ UNSET
3168
+ )
2958
3169
  r"""Log probability information for the choice."""
2959
3170
 
2960
3171
  @model_serializer(mode="wrap")
@@ -2983,14 +3194,14 @@ class CreateChatCompletionRouterChoices(BaseModel):
2983
3194
  return m
2984
3195
 
2985
3196
 
2986
- class CreateChatCompletionRouterPromptTokensDetailsTypedDict(TypedDict):
3197
+ class CreateChatCompletionRouterChatCompletionsPromptTokensDetailsTypedDict(TypedDict):
2987
3198
  cached_tokens: NotRequired[Nullable[int]]
2988
3199
  cache_creation_tokens: NotRequired[Nullable[int]]
2989
3200
  audio_tokens: NotRequired[Nullable[int]]
2990
3201
  r"""The number of audio input tokens consumed by the request."""
2991
3202
 
2992
3203
 
2993
- class CreateChatCompletionRouterPromptTokensDetails(BaseModel):
3204
+ class CreateChatCompletionRouterChatCompletionsPromptTokensDetails(BaseModel):
2994
3205
  cached_tokens: OptionalNullable[int] = UNSET
2995
3206
 
2996
3207
  cache_creation_tokens: OptionalNullable[int] = UNSET
@@ -3028,7 +3239,9 @@ class CreateChatCompletionRouterPromptTokensDetails(BaseModel):
3028
3239
  return m
3029
3240
 
3030
3241
 
3031
- class CreateChatCompletionRouterCompletionTokensDetailsTypedDict(TypedDict):
3242
+ class CreateChatCompletionRouterChatCompletionsCompletionTokensDetailsTypedDict(
3243
+ TypedDict
3244
+ ):
3032
3245
  reasoning_tokens: NotRequired[Nullable[float]]
3033
3246
  accepted_prediction_tokens: NotRequired[Nullable[float]]
3034
3247
  rejected_prediction_tokens: NotRequired[Nullable[float]]
@@ -3036,7 +3249,7 @@ class CreateChatCompletionRouterCompletionTokensDetailsTypedDict(TypedDict):
3036
3249
  r"""The number of audio output tokens produced by the response."""
3037
3250
 
3038
3251
 
3039
- class CreateChatCompletionRouterCompletionTokensDetails(BaseModel):
3252
+ class CreateChatCompletionRouterChatCompletionsCompletionTokensDetails(BaseModel):
3040
3253
  reasoning_tokens: OptionalNullable[float] = UNSET
3041
3254
 
3042
3255
  accepted_prediction_tokens: OptionalNullable[float] = UNSET
@@ -3086,7 +3299,7 @@ class CreateChatCompletionRouterCompletionTokensDetails(BaseModel):
3086
3299
  return m
3087
3300
 
3088
3301
 
3089
- class CreateChatCompletionRouterUsageTypedDict(TypedDict):
3302
+ class CreateChatCompletionRouterChatCompletionsUsageTypedDict(TypedDict):
3090
3303
  r"""Usage statistics for the completion request."""
3091
3304
 
3092
3305
  completion_tokens: NotRequired[float]
@@ -3096,14 +3309,16 @@ class CreateChatCompletionRouterUsageTypedDict(TypedDict):
3096
3309
  total_tokens: NotRequired[float]
3097
3310
  r"""Total number of tokens used in the request (prompt + completion)."""
3098
3311
  prompt_tokens_details: NotRequired[
3099
- Nullable[CreateChatCompletionRouterPromptTokensDetailsTypedDict]
3312
+ Nullable[CreateChatCompletionRouterChatCompletionsPromptTokensDetailsTypedDict]
3100
3313
  ]
3101
3314
  completion_tokens_details: NotRequired[
3102
- Nullable[CreateChatCompletionRouterCompletionTokensDetailsTypedDict]
3315
+ Nullable[
3316
+ CreateChatCompletionRouterChatCompletionsCompletionTokensDetailsTypedDict
3317
+ ]
3103
3318
  ]
3104
3319
 
3105
3320
 
3106
- class CreateChatCompletionRouterUsage(BaseModel):
3321
+ class CreateChatCompletionRouterChatCompletionsUsage(BaseModel):
3107
3322
  r"""Usage statistics for the completion request."""
3108
3323
 
3109
3324
  completion_tokens: Optional[float] = None
@@ -3116,11 +3331,11 @@ class CreateChatCompletionRouterUsage(BaseModel):
3116
3331
  r"""Total number of tokens used in the request (prompt + completion)."""
3117
3332
 
3118
3333
  prompt_tokens_details: OptionalNullable[
3119
- CreateChatCompletionRouterPromptTokensDetails
3334
+ CreateChatCompletionRouterChatCompletionsPromptTokensDetails
3120
3335
  ] = UNSET
3121
3336
 
3122
3337
  completion_tokens_details: OptionalNullable[
3123
- CreateChatCompletionRouterCompletionTokensDetails
3338
+ CreateChatCompletionRouterChatCompletionsCompletionTokensDetails
3124
3339
  ] = UNSET
3125
3340
 
3126
3341
  @model_serializer(mode="wrap")
@@ -3157,7 +3372,7 @@ class CreateChatCompletionRouterUsage(BaseModel):
3157
3372
  return m
3158
3373
 
3159
3374
 
3160
- CreateChatCompletionRouterObject = Literal["chat.completion.chunk",]
3375
+ CreateChatCompletionRouterChatCompletionsObject = Literal["chat.completion.chunk",]
3161
3376
 
3162
3377
 
3163
3378
  class CreateChatCompletionDataTypedDict(TypedDict):
@@ -3165,16 +3380,18 @@ class CreateChatCompletionDataTypedDict(TypedDict):
3165
3380
 
3166
3381
  id: str
3167
3382
  r"""A unique identifier for the chat completion."""
3168
- choices: List[CreateChatCompletionRouterChoicesTypedDict]
3383
+ choices: List[CreateChatCompletionRouterChatCompletionsChoicesTypedDict]
3169
3384
  r"""A list of chat completion choices. Can contain more than one elements if n is greater than 1. Can also be empty for the last chunk if you set stream_options: {\"include_usage\": true}."""
3170
3385
  created: float
3171
3386
  r"""The Unix timestamp (in seconds) of when the chat completion was created."""
3172
3387
  model: str
3173
3388
  r"""The model used for the chat completion."""
3174
- object: CreateChatCompletionRouterObject
3389
+ object: CreateChatCompletionRouterChatCompletionsObject
3175
3390
  system_fingerprint: NotRequired[Nullable[str]]
3176
3391
  r"""This fingerprint represents the backend configuration that the model runs with."""
3177
- usage: NotRequired[Nullable[CreateChatCompletionRouterUsageTypedDict]]
3392
+ usage: NotRequired[
3393
+ Nullable[CreateChatCompletionRouterChatCompletionsUsageTypedDict]
3394
+ ]
3178
3395
  r"""Usage statistics for the completion request."""
3179
3396
 
3180
3397
 
@@ -3184,7 +3401,7 @@ class CreateChatCompletionData(BaseModel):
3184
3401
  id: str
3185
3402
  r"""A unique identifier for the chat completion."""
3186
3403
 
3187
- choices: List[CreateChatCompletionRouterChoices]
3404
+ choices: List[CreateChatCompletionRouterChatCompletionsChoices]
3188
3405
  r"""A list of chat completion choices. Can contain more than one elements if n is greater than 1. Can also be empty for the last chunk if you set stream_options: {\"include_usage\": true}."""
3189
3406
 
3190
3407
  created: float
@@ -3193,12 +3410,12 @@ class CreateChatCompletionData(BaseModel):
3193
3410
  model: str
3194
3411
  r"""The model used for the chat completion."""
3195
3412
 
3196
- object: CreateChatCompletionRouterObject
3413
+ object: CreateChatCompletionRouterChatCompletionsObject
3197
3414
 
3198
3415
  system_fingerprint: OptionalNullable[str] = UNSET
3199
3416
  r"""This fingerprint represents the backend configuration that the model runs with."""
3200
3417
 
3201
- usage: OptionalNullable[CreateChatCompletionRouterUsage] = UNSET
3418
+ usage: OptionalNullable[CreateChatCompletionRouterChatCompletionsUsage] = UNSET
3202
3419
  r"""Usage statistics for the completion request."""
3203
3420
 
3204
3421
  @model_serializer(mode="wrap")
@@ -3227,14 +3444,14 @@ class CreateChatCompletionData(BaseModel):
3227
3444
  return m
3228
3445
 
3229
3446
 
3230
- class CreateChatCompletionRouterResponseBodyTypedDict(TypedDict):
3447
+ class CreateChatCompletionRouterChatCompletionsResponseBodyTypedDict(TypedDict):
3231
3448
  r"""Represents a streamed chunk of a chat completion response returned by model, based on the provided input."""
3232
3449
 
3233
3450
  data: NotRequired[CreateChatCompletionDataTypedDict]
3234
3451
  r"""Represents a streamed chunk of a chat completion response returned by model, based on the provided input."""
3235
3452
 
3236
3453
 
3237
- class CreateChatCompletionRouterResponseBody(BaseModel):
3454
+ class CreateChatCompletionRouterChatCompletionsResponseBody(BaseModel):
3238
3455
  r"""Represents a streamed chunk of a chat completion response returned by model, based on the provided input."""
3239
3456
 
3240
3457
  data: Optional[CreateChatCompletionData] = None
@@ -3267,17 +3484,17 @@ CreateChatCompletionFinishReason = Literal[
3267
3484
  r"""The reason the model stopped generating tokens."""
3268
3485
 
3269
3486
 
3270
- CreateChatCompletionRouterResponseType = Literal["function",]
3487
+ CreateChatCompletionRouterChatCompletionsResponseType = Literal["function",]
3271
3488
 
3272
3489
 
3273
- class CreateChatCompletionRouterFunctionTypedDict(TypedDict):
3490
+ class CreateChatCompletionRouterChatCompletionsFunctionTypedDict(TypedDict):
3274
3491
  name: NotRequired[str]
3275
3492
  r"""The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."""
3276
3493
  arguments: NotRequired[str]
3277
3494
  r"""The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function."""
3278
3495
 
3279
3496
 
3280
- class CreateChatCompletionRouterFunction(BaseModel):
3497
+ class CreateChatCompletionRouterChatCompletionsFunction(BaseModel):
3281
3498
  name: Optional[str] = None
3282
3499
  r"""The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."""
3283
3500
 
@@ -3304,8 +3521,8 @@ class CreateChatCompletionRouterFunction(BaseModel):
3304
3521
  class CreateChatCompletionToolCallsTypedDict(TypedDict):
3305
3522
  index: NotRequired[float]
3306
3523
  id: NotRequired[str]
3307
- type: NotRequired[CreateChatCompletionRouterResponseType]
3308
- function: NotRequired[CreateChatCompletionRouterFunctionTypedDict]
3524
+ type: NotRequired[CreateChatCompletionRouterChatCompletionsResponseType]
3525
+ function: NotRequired[CreateChatCompletionRouterChatCompletionsFunctionTypedDict]
3309
3526
  thought_signature: NotRequired[str]
3310
3527
  r"""Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call."""
3311
3528
 
@@ -3315,9 +3532,9 @@ class CreateChatCompletionToolCalls(BaseModel):
3315
3532
 
3316
3533
  id: Optional[str] = None
3317
3534
 
3318
- type: Optional[CreateChatCompletionRouterResponseType] = None
3535
+ type: Optional[CreateChatCompletionRouterChatCompletionsResponseType] = None
3319
3536
 
3320
- function: Optional[CreateChatCompletionRouterFunction] = None
3537
+ function: Optional[CreateChatCompletionRouterChatCompletionsFunction] = None
3321
3538
 
3322
3539
  thought_signature: Optional[str] = None
3323
3540
  r"""Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call."""
@@ -3342,7 +3559,7 @@ class CreateChatCompletionToolCalls(BaseModel):
3342
3559
  CreateChatCompletionRole = Literal["assistant",]
3343
3560
 
3344
3561
 
3345
- class CreateChatCompletionRouterAudioTypedDict(TypedDict):
3562
+ class CreateChatCompletionRouterChatCompletionsAudioTypedDict(TypedDict):
3346
3563
  r"""If the audio output modality is requested, this object contains data about the audio response from the model."""
3347
3564
 
3348
3565
  id: str
@@ -3351,7 +3568,7 @@ class CreateChatCompletionRouterAudioTypedDict(TypedDict):
3351
3568
  transcript: str
3352
3569
 
3353
3570
 
3354
- class CreateChatCompletionRouterAudio(BaseModel):
3571
+ class CreateChatCompletionRouterChatCompletionsAudio(BaseModel):
3355
3572
  r"""If the audio output modality is requested, this object contains data about the audio response from the model."""
3356
3573
 
3357
3574
  id: str
@@ -3376,7 +3593,9 @@ class CreateChatCompletionMessageTypedDict(TypedDict):
3376
3593
  r"""The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`."""
3377
3594
  redacted_reasoning: NotRequired[str]
3378
3595
  r"""Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context."""
3379
- audio: NotRequired[Nullable[CreateChatCompletionRouterAudioTypedDict]]
3596
+ audio: NotRequired[
3597
+ Nullable[CreateChatCompletionRouterChatCompletionsAudioTypedDict]
3598
+ ]
3380
3599
  r"""If the audio output modality is requested, this object contains data about the audio response from the model."""
3381
3600
 
3382
3601
 
@@ -3400,7 +3619,7 @@ class CreateChatCompletionMessage(BaseModel):
3400
3619
  redacted_reasoning: Optional[str] = None
3401
3620
  r"""Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context."""
3402
3621
 
3403
- audio: OptionalNullable[CreateChatCompletionRouterAudio] = UNSET
3622
+ audio: OptionalNullable[CreateChatCompletionRouterChatCompletionsAudio] = UNSET
3404
3623
  r"""If the audio output modality is requested, this object contains data about the audio response from the model."""
3405
3624
 
3406
3625
  @model_serializer(mode="wrap")
@@ -3515,7 +3734,7 @@ class CreateChatCompletionContent(BaseModel):
3515
3734
  return m
3516
3735
 
3517
3736
 
3518
- class CreateChatCompletionRouterTopLogprobsTypedDict(TypedDict):
3737
+ class CreateChatCompletionRouterChatCompletionsTopLogprobsTypedDict(TypedDict):
3519
3738
  token: str
3520
3739
  r"""The token."""
3521
3740
  logprob: float
@@ -3524,7 +3743,7 @@ class CreateChatCompletionRouterTopLogprobsTypedDict(TypedDict):
3524
3743
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
3525
3744
 
3526
3745
 
3527
- class CreateChatCompletionRouterTopLogprobs(BaseModel):
3746
+ class CreateChatCompletionRouterChatCompletionsTopLogprobs(BaseModel):
3528
3747
  token: str
3529
3748
  r"""The token."""
3530
3749
 
@@ -3556,7 +3775,7 @@ class CreateChatCompletionRefusalTypedDict(TypedDict):
3556
3775
  r"""The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely."""
3557
3776
  bytes_: Nullable[List[float]]
3558
3777
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
3559
- top_logprobs: List[CreateChatCompletionRouterTopLogprobsTypedDict]
3778
+ top_logprobs: List[CreateChatCompletionRouterChatCompletionsTopLogprobsTypedDict]
3560
3779
  r"""List of the most likely tokens and their log probability, at this token position."""
3561
3780
 
3562
3781
 
@@ -3570,7 +3789,7 @@ class CreateChatCompletionRefusal(BaseModel):
3570
3789
  bytes_: Annotated[Nullable[List[float]], pydantic.Field(alias="bytes")]
3571
3790
  r"""A list of integers representing the UTF-8 bytes representation of the token."""
3572
3791
 
3573
- top_logprobs: List[CreateChatCompletionRouterTopLogprobs]
3792
+ top_logprobs: List[CreateChatCompletionRouterChatCompletionsTopLogprobs]
3574
3793
  r"""List of the most likely tokens and their log probability, at this token position."""
3575
3794
 
3576
3795
  @model_serializer(mode="wrap")
@@ -3920,9 +4139,11 @@ CreateChatCompletionResponseTypedDict = TypeAliasType(
3920
4139
  Union[
3921
4140
  CreateChatCompletionResponseBodyTypedDict,
3922
4141
  Union[
3923
- eventstreaming.EventStream[CreateChatCompletionRouterResponseBodyTypedDict],
4142
+ eventstreaming.EventStream[
4143
+ CreateChatCompletionRouterChatCompletionsResponseBodyTypedDict
4144
+ ],
3924
4145
  eventstreaming.EventStreamAsync[
3925
- CreateChatCompletionRouterResponseBodyTypedDict
4146
+ CreateChatCompletionRouterChatCompletionsResponseBodyTypedDict
3926
4147
  ],
3927
4148
  ],
3928
4149
  ],
@@ -3934,8 +4155,12 @@ CreateChatCompletionResponse = TypeAliasType(
3934
4155
  Union[
3935
4156
  CreateChatCompletionResponseBody,
3936
4157
  Union[
3937
- eventstreaming.EventStream[CreateChatCompletionRouterResponseBody],
3938
- eventstreaming.EventStreamAsync[CreateChatCompletionRouterResponseBody],
4158
+ eventstreaming.EventStream[
4159
+ CreateChatCompletionRouterChatCompletionsResponseBody
4160
+ ],
4161
+ eventstreaming.EventStreamAsync[
4162
+ CreateChatCompletionRouterChatCompletionsResponseBody
4163
+ ],
3939
4164
  ],
3940
4165
  ],
3941
4166
  )