From 10b1e36e25543d921dc9fee6804a268a8408a7df Mon Sep 17 00:00:00 2001 From: Stainless Bot Date: Wed, 8 Nov 2023 11:59:24 +0000 Subject: [PATCH] fix(api): accidentally required params, add new models & other fixes - Mark chat completion image url as required - Add system_fingerprint to chat completions --- src/openai/resources/chat/completions.py | 16 ++++++++++++++++ src/openai/types/chat/chat_completion_chunk.py | 7 +++++++ .../chat_completion_content_part_image_param.py | 6 +++--- .../types/chat/completion_create_params.py | 2 ++ 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/openai/resources/chat/completions.py b/src/openai/resources/chat/completions.py index a46e7e70d6..75e0d66d58 100644 --- a/src/openai/resources/chat/completions.py +++ b/src/openai/resources/chat/completions.py @@ -43,6 +43,8 @@ def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", @@ -201,6 +203,8 @@ def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", @@ -359,6 +363,8 @@ def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", @@ -517,6 +523,8 @@ def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", @@ -602,6 +610,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", @@ -760,6 +770,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", @@ -918,6 +930,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", @@ -1076,6 +1090,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", diff --git a/src/openai/types/chat/chat_completion_chunk.py b/src/openai/types/chat/chat_completion_chunk.py index bbc46a37bb..568f530280 100644 --- a/src/openai/types/chat/chat_completion_chunk.py +++ b/src/openai/types/chat/chat_completion_chunk.py @@ -109,3 +109,10 @@ class ChatCompletionChunk(BaseModel): object: Literal["chat.completion.chunk"] """The object type, which is always `chat.completion.chunk`.""" + + system_fingerprint: Optional[str] = None + """This fingerprint represents the backend configuration that the model runs with. + + Can be used in conjunction with the `seed` request parameter to understand when + backend changes have been made that might impact determinism. + """ diff --git a/src/openai/types/chat/chat_completion_content_part_image_param.py b/src/openai/types/chat/chat_completion_content_part_image_param.py index 2051786562..eb9bd52689 100644 --- a/src/openai/types/chat/chat_completion_content_part_image_param.py +++ b/src/openai/types/chat/chat_completion_content_part_image_param.py @@ -8,12 +8,12 @@ class ImageURL(TypedDict, total=False): + url: Required[str] + """Either a URL of the image or the base64 encoded image data.""" + detail: Literal["auto", "low", "high"] """Specifies the detail level of the image.""" - url: str - """Either a URL of the image or the base64 encoded image data.""" - class ChatCompletionContentPartImageParam(TypedDict, total=False): image_url: Required[ImageURL] diff --git a/src/openai/types/chat/completion_create_params.py b/src/openai/types/chat/completion_create_params.py index 44b1abe576..b310761077 100644 --- a/src/openai/types/chat/completion_create_params.py +++ b/src/openai/types/chat/completion_create_params.py @@ -35,6 +35,8 @@ class CompletionCreateParamsBase(TypedDict, total=False): Union[ str, Literal[ + "gpt-4-1106-preview", + "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613",