Skip to content

Commit 03c3e03

Browse files
fix(api): accidentally required params, add new models & other fixes (#729)
- Mark chat completion image url as required - Add system_fingerprint to chat completions
1 parent 0cda8ca commit 03c3e03

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

src/openai/resources/chat/completions.py

+16
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def create(
4343
model: Union[
4444
str,
4545
Literal[
46+
"gpt-4-1106-preview",
47+
"gpt-4-vision-preview",
4648
"gpt-4",
4749
"gpt-4-0314",
4850
"gpt-4-0613",
@@ -201,6 +203,8 @@ def create(
201203
model: Union[
202204
str,
203205
Literal[
206+
"gpt-4-1106-preview",
207+
"gpt-4-vision-preview",
204208
"gpt-4",
205209
"gpt-4-0314",
206210
"gpt-4-0613",
@@ -359,6 +363,8 @@ def create(
359363
model: Union[
360364
str,
361365
Literal[
366+
"gpt-4-1106-preview",
367+
"gpt-4-vision-preview",
362368
"gpt-4",
363369
"gpt-4-0314",
364370
"gpt-4-0613",
@@ -517,6 +523,8 @@ def create(
517523
model: Union[
518524
str,
519525
Literal[
526+
"gpt-4-1106-preview",
527+
"gpt-4-vision-preview",
520528
"gpt-4",
521529
"gpt-4-0314",
522530
"gpt-4-0613",
@@ -602,6 +610,8 @@ async def create(
602610
model: Union[
603611
str,
604612
Literal[
613+
"gpt-4-1106-preview",
614+
"gpt-4-vision-preview",
605615
"gpt-4",
606616
"gpt-4-0314",
607617
"gpt-4-0613",
@@ -760,6 +770,8 @@ async def create(
760770
model: Union[
761771
str,
762772
Literal[
773+
"gpt-4-1106-preview",
774+
"gpt-4-vision-preview",
763775
"gpt-4",
764776
"gpt-4-0314",
765777
"gpt-4-0613",
@@ -918,6 +930,8 @@ async def create(
918930
model: Union[
919931
str,
920932
Literal[
933+
"gpt-4-1106-preview",
934+
"gpt-4-vision-preview",
921935
"gpt-4",
922936
"gpt-4-0314",
923937
"gpt-4-0613",
@@ -1076,6 +1090,8 @@ async def create(
10761090
model: Union[
10771091
str,
10781092
Literal[
1093+
"gpt-4-1106-preview",
1094+
"gpt-4-vision-preview",
10791095
"gpt-4",
10801096
"gpt-4-0314",
10811097
"gpt-4-0613",

src/openai/types/chat/chat_completion_chunk.py

+7
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,10 @@ class ChatCompletionChunk(BaseModel):
109109

110110
object: Literal["chat.completion.chunk"]
111111
"""The object type, which is always `chat.completion.chunk`."""
112+
113+
system_fingerprint: Optional[str] = None
114+
"""This fingerprint represents the backend configuration that the model runs with.
115+
116+
Can be used in conjunction with the `seed` request parameter to understand when
117+
backend changes have been made that might impact determinism.
118+
"""

src/openai/types/chat/chat_completion_content_part_image_param.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99

1010
class ImageURL(TypedDict, total=False):
11+
url: Required[str]
12+
"""Either a URL of the image or the base64 encoded image data."""
13+
1114
detail: Literal["auto", "low", "high"]
1215
"""Specifies the detail level of the image."""
1316

14-
url: str
15-
"""Either a URL of the image or the base64 encoded image data."""
16-
1717

1818
class ChatCompletionContentPartImageParam(TypedDict, total=False):
1919
image_url: Required[ImageURL]

src/openai/types/chat/completion_create_params.py

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class CompletionCreateParamsBase(TypedDict, total=False):
3535
Union[
3636
str,
3737
Literal[
38+
"gpt-4-1106-preview",
39+
"gpt-4-vision-preview",
3840
"gpt-4",
3941
"gpt-4-0314",
4042
"gpt-4-0613",

0 commit comments

Comments
 (0)