Skip to content

Commit

Permalink
fix(api): accidentally required params, add new models & other fixes (#…
Browse files Browse the repository at this point in the history
…729)

- Mark chat completion image url as required
- Add system_fingerprint to chat completions
  • Loading branch information
stainless-bot committed Nov 8, 2023
1 parent a816967 commit 4f89244
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/openai/resources/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions src/openai/types/chat/chat_completion_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 2 additions & 0 deletions src/openai/types/chat/completion_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4f89244

Please sign in to comment.