From 4c222adf71202917b0754fcefcc1305220ff686b Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Mon, 13 May 2024 14:15:32 -0400 Subject: [PATCH] feat(api): add gpt-4o model (#1417) --- .stats.yml | 2 +- src/openai/resources/beta/assistants.py | 4 ++ .../resources/beta/threads/runs/runs.py | 44 +++++++++++++++++++ src/openai/resources/beta/threads/threads.py | 32 ++++++++++++++ .../types/beta/assistant_create_params.py | 2 + .../beta/thread_create_and_run_params.py | 2 + .../types/beta/threads/run_create_params.py | 2 + src/openai/types/chat_model.py | 2 + 8 files changed, 89 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 52e87d1b58..f44b9b46af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 64 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-084b8f68408c6b689a55200a78bcf233769bfcd8e999d9fadaeb399152b05bcd.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-47007cc1aa5bc7b74107a99b377925978a0bd376ed67bdae724e80d5d0b63d57.yml diff --git a/src/openai/resources/beta/assistants.py b/src/openai/resources/beta/assistants.py index 923ad95a54..2304452493 100644 --- a/src/openai/resources/beta/assistants.py +++ b/src/openai/resources/beta/assistants.py @@ -49,6 +49,8 @@ def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -434,6 +436,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", diff --git a/src/openai/resources/beta/threads/runs/runs.py b/src/openai/resources/beta/threads/runs/runs.py index 2cd6e60239..84b0d63c25 100644 --- a/src/openai/resources/beta/threads/runs/runs.py +++ b/src/openai/resources/beta/threads/runs/runs.py @@ -85,6 +85,8 @@ def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -230,6 +232,8 @@ def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -374,6 +378,8 @@ def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -517,6 +523,8 @@ def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -784,6 +792,8 @@ def create_and_poll( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -874,6 +884,8 @@ def create_and_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -928,6 +940,8 @@ def create_and_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -982,6 +996,8 @@ def create_and_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1120,6 +1136,8 @@ def stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1173,6 +1191,8 @@ def stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1226,6 +1246,8 @@ def stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1617,6 +1639,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1762,6 +1786,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1906,6 +1932,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2049,6 +2077,8 @@ async def create( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2316,6 +2346,8 @@ async def create_and_poll( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2406,6 +2438,8 @@ def create_and_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2460,6 +2494,8 @@ def create_and_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2514,6 +2550,8 @@ def create_and_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2654,6 +2692,8 @@ def stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2707,6 +2747,8 @@ def stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -2760,6 +2802,8 @@ def stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", diff --git a/src/openai/resources/beta/threads/threads.py b/src/openai/resources/beta/threads/threads.py index 2455272658..a68cbe0ddd 100644 --- a/src/openai/resources/beta/threads/threads.py +++ b/src/openai/resources/beta/threads/threads.py @@ -267,6 +267,8 @@ def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -411,6 +413,8 @@ def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -554,6 +558,8 @@ def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -696,6 +702,8 @@ def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -776,6 +784,8 @@ def create_and_run_poll( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -854,6 +864,8 @@ def create_and_run_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -906,6 +918,8 @@ def create_and_run_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -958,6 +972,8 @@ def create_and_run_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1241,6 +1257,8 @@ async def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1385,6 +1403,8 @@ async def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1528,6 +1548,8 @@ async def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1670,6 +1692,8 @@ async def create_and_run( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1750,6 +1774,8 @@ async def create_and_run_poll( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1830,6 +1856,8 @@ def create_and_run_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1882,6 +1910,8 @@ def create_and_run_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", @@ -1934,6 +1964,8 @@ def create_and_run_stream( model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", diff --git a/src/openai/types/beta/assistant_create_params.py b/src/openai/types/beta/assistant_create_params.py index e9ff66dfc3..d44e15f4ca 100644 --- a/src/openai/types/beta/assistant_create_params.py +++ b/src/openai/types/beta/assistant_create_params.py @@ -22,6 +22,8 @@ class AssistantCreateParams(TypedDict, total=False): Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", diff --git a/src/openai/types/beta/thread_create_and_run_params.py b/src/openai/types/beta/thread_create_and_run_params.py index 80349678c2..9567c8320a 100644 --- a/src/openai/types/beta/thread_create_and_run_params.py +++ b/src/openai/types/beta/thread_create_and_run_params.py @@ -75,6 +75,8 @@ class ThreadCreateAndRunParamsBase(TypedDict, total=False): model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", diff --git a/src/openai/types/beta/threads/run_create_params.py b/src/openai/types/beta/threads/run_create_params.py index 9f534045ae..dca47a5c73 100644 --- a/src/openai/types/beta/threads/run_create_params.py +++ b/src/openai/types/beta/threads/run_create_params.py @@ -77,6 +77,8 @@ class RunCreateParamsBase(TypedDict, total=False): model: Union[ str, Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", diff --git a/src/openai/types/chat_model.py b/src/openai/types/chat_model.py index 219dab5138..0d2937ea32 100644 --- a/src/openai/types/chat_model.py +++ b/src/openai/types/chat_model.py @@ -5,6 +5,8 @@ __all__ = ["ChatModel"] ChatModel = Literal[ + "gpt-4o", + "gpt-4o-2024-05-13", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview",