|
1 | 1 | # mypy: ignore-errors |
2 | 2 | # generated by datamodel-codegen: |
3 | 3 | # filename: openai-spec.yaml |
4 | | -# timestamp: 2025-12-19T20:33:10+00:00 |
| 4 | +# timestamp: 2026-01-10T00:37:57+00:00 |
5 | 5 |
|
6 | 6 | from __future__ import annotations |
7 | 7 |
|
8 | | -from typing import Annotated, Any, Dict, List, Literal, Optional, Union |
| 8 | +from typing import Any, Dict, List, Literal, Optional, Union |
9 | 9 |
|
10 | 10 | import pydantic |
11 | 11 |
|
|
14 | 14 | from pydantic.v1 import AnyUrl, BaseModel, Extra, Field # noqa: F401 |
15 | 15 | else: |
16 | 16 | from pydantic import AnyUrl, BaseModel, Extra, Field # type: ignore # noqa: F401 |
| 17 | +from typing_extensions import Annotated |
17 | 18 |
|
18 | 19 |
|
19 | 20 | class AddUploadPartRequest(BaseModel): |
@@ -932,10 +933,10 @@ class Audio1(BaseModel): |
932 | 933 |
|
933 | 934 |
|
934 | 935 | class ChatCompletionResponseMessage(BaseModel): |
935 | | - content: Annotated[Optional[str], Field(description="The contents of the message.")] |
| 936 | + content: Annotated[Optional[str], Field(description="The contents of the message.")] = None |
936 | 937 | refusal: Annotated[ |
937 | 938 | Optional[str], Field(description="The refusal message generated by the model.") |
938 | | - ] |
| 939 | + ] = None |
939 | 940 | tool_calls: Optional[ChatCompletionMessageToolCalls] = None |
940 | 941 | annotations: Annotated[ |
941 | 942 | Optional[List[Annotation]], |
@@ -3593,7 +3594,7 @@ class MessageStreamEvent3(BaseModel): |
3593 | 3594 |
|
3594 | 3595 |
|
3595 | 3596 | class Metadata(BaseModel): |
3596 | | - __root__: Dict[str, str] |
| 3597 | + __root__: Optional[Dict[str, str]] = None |
3597 | 3598 |
|
3598 | 3599 |
|
3599 | 3600 | class Model(BaseModel): |
@@ -6703,7 +6704,7 @@ class VectorStoreFileAttributes1(BaseModel): |
6703 | 6704 |
|
6704 | 6705 |
|
6705 | 6706 | class VectorStoreFileAttributes(BaseModel): |
6706 | | - __root__: Dict[str, Union[VectorStoreFileAttributes1, float, bool]] |
| 6707 | + __root__: Optional[Dict[str, Union[VectorStoreFileAttributes1, float, bool]]] = None |
6707 | 6708 |
|
6708 | 6709 |
|
6709 | 6710 | class FileCounts(BaseModel): |
@@ -7728,7 +7729,7 @@ class WebSearchOptions(BaseModel): |
7728 | 7729 | Optional[UserLocation], |
7729 | 7730 | Field(description="Approximate location parameters for the search.\n"), |
7730 | 7731 | ] = None |
7731 | | - search_context_size: Annotated[Optional[WebSearchContextSize], Field()] = "medium" |
| 7732 | + search_context_size: Optional[WebSearchContextSize] = None |
7732 | 7733 |
|
7733 | 7734 |
|
7734 | 7735 | class Audio2(BaseModel): |
@@ -7761,7 +7762,7 @@ class CreateChatCompletionResponse(BaseModel): |
7761 | 7762 | ), |
7762 | 7763 | ] |
7763 | 7764 | model: Annotated[str, Field(description="The model used for the chat completion.")] |
7764 | | - service_tier: Annotated[Optional[ServiceTier], Field()] = "auto" |
| 7765 | + service_tier: Optional[ServiceTier] = None |
7765 | 7766 | system_fingerprint: Annotated[ |
7766 | 7767 | Optional[str], |
7767 | 7768 | Field( |
@@ -7795,7 +7796,7 @@ class CreateChatCompletionStreamResponse(BaseModel): |
7795 | 7796 | ), |
7796 | 7797 | ] |
7797 | 7798 | model: Annotated[str, Field(description="The model to generate the completion.")] |
7798 | | - service_tier: Annotated[Optional[ServiceTier], Field()] = "auto" |
| 7799 | + service_tier: Optional[ServiceTier] = None |
7799 | 7800 | system_fingerprint: Annotated[ |
7800 | 7801 | Optional[str], |
7801 | 7802 | Field( |
@@ -8157,7 +8158,7 @@ class Config: |
8157 | 8158 | description="An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text#prompting) should match the audio language.\n" |
8158 | 8159 | ), |
8159 | 8160 | ] = None |
8160 | | - response_format: Annotated[Optional[AudioResponseFormat], Field()] = "json" |
| 8161 | + response_format: Optional[AudioResponseFormat] = None |
8161 | 8162 | temperature: Annotated[ |
8162 | 8163 | float, |
8163 | 8164 | Field( |
@@ -8358,7 +8359,7 @@ class EvalResponsesSource(BaseModel): |
8358 | 8359 | Field( |
8359 | 8360 | description="Optional reasoning effort parameter. This is a query parameter used to select responses." |
8360 | 8361 | ), |
8361 | | - ] = "medium" |
| 8362 | + ] = None |
8362 | 8363 | temperature: Annotated[ |
8363 | 8364 | Optional[float], |
8364 | 8365 | Field( |
@@ -8806,7 +8807,7 @@ class ModelResponseProperties(BaseModel): |
8806 | 8807 | example="user-1234", |
8807 | 8808 | ), |
8808 | 8809 | ] = None |
8809 | | - service_tier: Annotated[Optional[ServiceTier], Field()] = "auto" |
| 8810 | + service_tier: Optional[ServiceTier] = None |
8810 | 8811 |
|
8811 | 8812 |
|
8812 | 8813 | class OutputContent(BaseModel): |
@@ -9302,7 +9303,7 @@ class RealtimeSessionCreateResponse(BaseModel): |
9302 | 9303 |
|
9303 | 9304 |
|
9304 | 9305 | class Reasoning(BaseModel): |
9305 | | - effort: Annotated[Optional[ReasoningEffort], Field()] = "medium" |
| 9306 | + effort: Optional[ReasoningEffort] = None |
9306 | 9307 | summary: Annotated[ |
9307 | 9308 | Optional[Literal["auto", "concise", "detailed"]], |
9308 | 9309 | Field( |
@@ -9912,7 +9913,7 @@ class Config: |
9912 | 9913 | max_length=256000, |
9913 | 9914 | ), |
9914 | 9915 | ] = None |
9915 | | - reasoning_effort: Annotated[Optional[ReasoningEffort], Field()] = "medium" |
| 9916 | + reasoning_effort: Optional[ReasoningEffort] = None |
9916 | 9917 | tools: Annotated[ |
9917 | 9918 | List[Union[AssistantToolsCode, AssistantToolsFileSearch, AssistantToolsFunction]], |
9918 | 9919 | Field( |
@@ -10108,7 +10109,7 @@ class Config: |
10108 | 10109 | example="gpt-4o", |
10109 | 10110 | ), |
10110 | 10111 | ] = None |
10111 | | - reasoning_effort: Annotated[Optional[ReasoningEffort], Field()] = "medium" |
| 10112 | + reasoning_effort: Optional[ReasoningEffort] = None |
10112 | 10113 | instructions: Annotated[ |
10113 | 10114 | Optional[str], |
10114 | 10115 | Field( |
@@ -10173,7 +10174,7 @@ class Config: |
10173 | 10174 | ] = None |
10174 | 10175 | truncation_strategy: Optional[TruncationObject] = None |
10175 | 10176 | tool_choice: Optional[AssistantsApiToolChoiceOption] = None |
10176 | | - parallel_tool_calls: Annotated[Optional[ParallelToolCalls], Field()] = True |
| 10177 | + parallel_tool_calls: Optional[ParallelToolCalls] = None |
10177 | 10178 | response_format: Optional[AssistantsApiResponseFormatOption] = None |
10178 | 10179 |
|
10179 | 10180 |
|
@@ -10293,7 +10294,7 @@ class Config: |
10293 | 10294 | ] = None |
10294 | 10295 | truncation_strategy: Optional[TruncationObject] = None |
10295 | 10296 | tool_choice: Optional[AssistantsApiToolChoiceOption] = None |
10296 | | - parallel_tool_calls: Annotated[Optional[ParallelToolCalls], Field()] = True |
| 10297 | + parallel_tool_calls: Optional[ParallelToolCalls] = None |
10297 | 10298 | response_format: Optional[AssistantsApiResponseFormatOption] = None |
10298 | 10299 |
|
10299 | 10300 |
|
@@ -10394,7 +10395,7 @@ class FineTuneChatRequestInput(BaseModel): |
10394 | 10395 | Optional[List[ChatCompletionTool]], |
10395 | 10396 | Field(description="A list of tools the model may generate JSON inputs for."), |
10396 | 10397 | ] = None |
10397 | | - parallel_tool_calls: Annotated[Optional[ParallelToolCalls], Field()] = True |
| 10398 | + parallel_tool_calls: Optional[ParallelToolCalls] = None |
10398 | 10399 | functions: Annotated[ |
10399 | 10400 | Optional[List[ChatCompletionFunctions]], |
10400 | 10401 | Field( |
@@ -10424,7 +10425,7 @@ class Input5(BaseModel): |
10424 | 10425 | Optional[List[ChatCompletionTool]], |
10425 | 10426 | Field(description="A list of tools the model may generate JSON inputs for."), |
10426 | 10427 | ] = None |
10427 | | - parallel_tool_calls: Annotated[Optional[ParallelToolCalls], Field()] = True |
| 10428 | + parallel_tool_calls: Optional[ParallelToolCalls] = None |
10428 | 10429 |
|
10429 | 10430 |
|
10430 | 10431 | class FineTunePreferenceRequestInput(BaseModel): |
@@ -10536,7 +10537,7 @@ class Config: |
10536 | 10537 | description="ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models) for descriptions of them.\n" |
10537 | 10538 | ), |
10538 | 10539 | ] = None |
10539 | | - reasoning_effort: Annotated[Optional[ReasoningEffort], Field()] = "medium" |
| 10540 | + reasoning_effort: Optional[ReasoningEffort] = None |
10540 | 10541 | name: Annotated[ |
10541 | 10542 | Optional[str], |
10542 | 10543 | Field( |
@@ -11276,13 +11277,13 @@ class CreateChatCompletionRequest(CreateModelResponseProperties): |
11276 | 11277 | ), |
11277 | 11278 | ] |
11278 | 11279 | model: Annotated[ |
11279 | | - str, |
| 11280 | + ModelIdsShared, |
11280 | 11281 | Field( |
11281 | 11282 | description="Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\noffers a wide range of models with different capabilities, performance\ncharacteristics, and price points. Refer to the [model guide](/docs/models)\nto browse and compare available models.\n" |
11282 | 11283 | ), |
11283 | 11284 | ] |
11284 | 11285 | modalities: Optional[ResponseModalities] = None |
11285 | | - reasoning_effort: Annotated[Optional[ReasoningEffort], Field()] = "medium" |
| 11286 | + reasoning_effort: Optional[ReasoningEffort] = None |
11286 | 11287 | max_completion_tokens: Annotated[ |
11287 | 11288 | Optional[int], |
11288 | 11289 | Field( |
@@ -11394,7 +11395,7 @@ class CreateChatCompletionRequest(CreateModelResponseProperties): |
11394 | 11395 | ), |
11395 | 11396 | ] = None |
11396 | 11397 | tool_choice: Optional[ChatCompletionToolChoiceOption] = None |
11397 | | - parallel_tool_calls: Annotated[Optional[ParallelToolCalls], Field()] = True |
| 11398 | + parallel_tool_calls: Optional[ParallelToolCalls] = None |
11398 | 11399 | function_call: Annotated[ |
11399 | 11400 | Optional[Union[Literal["none", "auto"], ChatCompletionFunctionCallOption]], |
11400 | 11401 | Field( |
|
0 commit comments