Skip to content

Commit ac6c900

Browse files
committed
feat(api): add gpt-4o model (#1417)
1 parent c0afbc7 commit ac6c900

File tree

8 files changed

+89
-1
lines changed

8 files changed

+89
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 64
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-084b8f68408c6b689a55200a78bcf233769bfcd8e999d9fadaeb399152b05bcd.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-47007cc1aa5bc7b74107a99b377925978a0bd376ed67bdae724e80d5d0b63d57.yml

src/openai/resources/beta/assistants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def create(
4949
model: Union[
5050
str,
5151
Literal[
52+
"gpt-4o",
53+
"gpt-4o-2024-05-13",
5254
"gpt-4-turbo",
5355
"gpt-4-turbo-2024-04-09",
5456
"gpt-4-0125-preview",
@@ -434,6 +436,8 @@ async def create(
434436
model: Union[
435437
str,
436438
Literal[
439+
"gpt-4o",
440+
"gpt-4o-2024-05-13",
437441
"gpt-4-turbo",
438442
"gpt-4-turbo-2024-04-09",
439443
"gpt-4-0125-preview",

src/openai/resources/beta/threads/runs/runs.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def create(
8585
model: Union[
8686
str,
8787
Literal[
88+
"gpt-4o",
89+
"gpt-4o-2024-05-13",
8890
"gpt-4-turbo",
8991
"gpt-4-turbo-2024-04-09",
9092
"gpt-4-0125-preview",
@@ -230,6 +232,8 @@ def create(
230232
model: Union[
231233
str,
232234
Literal[
235+
"gpt-4o",
236+
"gpt-4o-2024-05-13",
233237
"gpt-4-turbo",
234238
"gpt-4-turbo-2024-04-09",
235239
"gpt-4-0125-preview",
@@ -374,6 +378,8 @@ def create(
374378
model: Union[
375379
str,
376380
Literal[
381+
"gpt-4o",
382+
"gpt-4o-2024-05-13",
377383
"gpt-4-turbo",
378384
"gpt-4-turbo-2024-04-09",
379385
"gpt-4-0125-preview",
@@ -517,6 +523,8 @@ def create(
517523
model: Union[
518524
str,
519525
Literal[
526+
"gpt-4o",
527+
"gpt-4o-2024-05-13",
520528
"gpt-4-turbo",
521529
"gpt-4-turbo-2024-04-09",
522530
"gpt-4-0125-preview",
@@ -784,6 +792,8 @@ def create_and_poll(
784792
model: Union[
785793
str,
786794
Literal[
795+
"gpt-4o",
796+
"gpt-4o-2024-05-13",
787797
"gpt-4-turbo",
788798
"gpt-4-turbo-2024-04-09",
789799
"gpt-4-0125-preview",
@@ -874,6 +884,8 @@ def create_and_stream(
874884
model: Union[
875885
str,
876886
Literal[
887+
"gpt-4o",
888+
"gpt-4o-2024-05-13",
877889
"gpt-4-turbo",
878890
"gpt-4-turbo-2024-04-09",
879891
"gpt-4-0125-preview",
@@ -928,6 +940,8 @@ def create_and_stream(
928940
model: Union[
929941
str,
930942
Literal[
943+
"gpt-4o",
944+
"gpt-4o-2024-05-13",
931945
"gpt-4-turbo",
932946
"gpt-4-turbo-2024-04-09",
933947
"gpt-4-0125-preview",
@@ -982,6 +996,8 @@ def create_and_stream(
982996
model: Union[
983997
str,
984998
Literal[
999+
"gpt-4o",
1000+
"gpt-4o-2024-05-13",
9851001
"gpt-4-turbo",
9861002
"gpt-4-turbo-2024-04-09",
9871003
"gpt-4-0125-preview",
@@ -1120,6 +1136,8 @@ def stream(
11201136
model: Union[
11211137
str,
11221138
Literal[
1139+
"gpt-4o",
1140+
"gpt-4o-2024-05-13",
11231141
"gpt-4-turbo",
11241142
"gpt-4-turbo-2024-04-09",
11251143
"gpt-4-0125-preview",
@@ -1173,6 +1191,8 @@ def stream(
11731191
model: Union[
11741192
str,
11751193
Literal[
1194+
"gpt-4o",
1195+
"gpt-4o-2024-05-13",
11761196
"gpt-4-turbo",
11771197
"gpt-4-turbo-2024-04-09",
11781198
"gpt-4-0125-preview",
@@ -1226,6 +1246,8 @@ def stream(
12261246
model: Union[
12271247
str,
12281248
Literal[
1249+
"gpt-4o",
1250+
"gpt-4o-2024-05-13",
12291251
"gpt-4-turbo",
12301252
"gpt-4-turbo-2024-04-09",
12311253
"gpt-4-0125-preview",
@@ -1617,6 +1639,8 @@ async def create(
16171639
model: Union[
16181640
str,
16191641
Literal[
1642+
"gpt-4o",
1643+
"gpt-4o-2024-05-13",
16201644
"gpt-4-turbo",
16211645
"gpt-4-turbo-2024-04-09",
16221646
"gpt-4-0125-preview",
@@ -1762,6 +1786,8 @@ async def create(
17621786
model: Union[
17631787
str,
17641788
Literal[
1789+
"gpt-4o",
1790+
"gpt-4o-2024-05-13",
17651791
"gpt-4-turbo",
17661792
"gpt-4-turbo-2024-04-09",
17671793
"gpt-4-0125-preview",
@@ -1906,6 +1932,8 @@ async def create(
19061932
model: Union[
19071933
str,
19081934
Literal[
1935+
"gpt-4o",
1936+
"gpt-4o-2024-05-13",
19091937
"gpt-4-turbo",
19101938
"gpt-4-turbo-2024-04-09",
19111939
"gpt-4-0125-preview",
@@ -2049,6 +2077,8 @@ async def create(
20492077
model: Union[
20502078
str,
20512079
Literal[
2080+
"gpt-4o",
2081+
"gpt-4o-2024-05-13",
20522082
"gpt-4-turbo",
20532083
"gpt-4-turbo-2024-04-09",
20542084
"gpt-4-0125-preview",
@@ -2316,6 +2346,8 @@ async def create_and_poll(
23162346
model: Union[
23172347
str,
23182348
Literal[
2349+
"gpt-4o",
2350+
"gpt-4o-2024-05-13",
23192351
"gpt-4-turbo",
23202352
"gpt-4-turbo-2024-04-09",
23212353
"gpt-4-0125-preview",
@@ -2406,6 +2438,8 @@ def create_and_stream(
24062438
model: Union[
24072439
str,
24082440
Literal[
2441+
"gpt-4o",
2442+
"gpt-4o-2024-05-13",
24092443
"gpt-4-turbo",
24102444
"gpt-4-turbo-2024-04-09",
24112445
"gpt-4-0125-preview",
@@ -2460,6 +2494,8 @@ def create_and_stream(
24602494
model: Union[
24612495
str,
24622496
Literal[
2497+
"gpt-4o",
2498+
"gpt-4o-2024-05-13",
24632499
"gpt-4-turbo",
24642500
"gpt-4-turbo-2024-04-09",
24652501
"gpt-4-0125-preview",
@@ -2514,6 +2550,8 @@ def create_and_stream(
25142550
model: Union[
25152551
str,
25162552
Literal[
2553+
"gpt-4o",
2554+
"gpt-4o-2024-05-13",
25172555
"gpt-4-turbo",
25182556
"gpt-4-turbo-2024-04-09",
25192557
"gpt-4-0125-preview",
@@ -2654,6 +2692,8 @@ def stream(
26542692
model: Union[
26552693
str,
26562694
Literal[
2695+
"gpt-4o",
2696+
"gpt-4o-2024-05-13",
26572697
"gpt-4-turbo",
26582698
"gpt-4-turbo-2024-04-09",
26592699
"gpt-4-0125-preview",
@@ -2707,6 +2747,8 @@ def stream(
27072747
model: Union[
27082748
str,
27092749
Literal[
2750+
"gpt-4o",
2751+
"gpt-4o-2024-05-13",
27102752
"gpt-4-turbo",
27112753
"gpt-4-turbo-2024-04-09",
27122754
"gpt-4-0125-preview",
@@ -2760,6 +2802,8 @@ def stream(
27602802
model: Union[
27612803
str,
27622804
Literal[
2805+
"gpt-4o",
2806+
"gpt-4o-2024-05-13",
27632807
"gpt-4-turbo",
27642808
"gpt-4-turbo-2024-04-09",
27652809
"gpt-4-0125-preview",

src/openai/resources/beta/threads/threads.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ def create_and_run(
267267
model: Union[
268268
str,
269269
Literal[
270+
"gpt-4o",
271+
"gpt-4o-2024-05-13",
270272
"gpt-4-turbo",
271273
"gpt-4-turbo-2024-04-09",
272274
"gpt-4-0125-preview",
@@ -411,6 +413,8 @@ def create_and_run(
411413
model: Union[
412414
str,
413415
Literal[
416+
"gpt-4o",
417+
"gpt-4o-2024-05-13",
414418
"gpt-4-turbo",
415419
"gpt-4-turbo-2024-04-09",
416420
"gpt-4-0125-preview",
@@ -554,6 +558,8 @@ def create_and_run(
554558
model: Union[
555559
str,
556560
Literal[
561+
"gpt-4o",
562+
"gpt-4o-2024-05-13",
557563
"gpt-4-turbo",
558564
"gpt-4-turbo-2024-04-09",
559565
"gpt-4-0125-preview",
@@ -696,6 +702,8 @@ def create_and_run(
696702
model: Union[
697703
str,
698704
Literal[
705+
"gpt-4o",
706+
"gpt-4o-2024-05-13",
699707
"gpt-4-turbo",
700708
"gpt-4-turbo-2024-04-09",
701709
"gpt-4-0125-preview",
@@ -776,6 +784,8 @@ def create_and_run_poll(
776784
model: Union[
777785
str,
778786
Literal[
787+
"gpt-4o",
788+
"gpt-4o-2024-05-13",
779789
"gpt-4-turbo",
780790
"gpt-4-turbo-2024-04-09",
781791
"gpt-4-0125-preview",
@@ -854,6 +864,8 @@ def create_and_run_stream(
854864
model: Union[
855865
str,
856866
Literal[
867+
"gpt-4o",
868+
"gpt-4o-2024-05-13",
857869
"gpt-4-turbo",
858870
"gpt-4-turbo-2024-04-09",
859871
"gpt-4-0125-preview",
@@ -906,6 +918,8 @@ def create_and_run_stream(
906918
model: Union[
907919
str,
908920
Literal[
921+
"gpt-4o",
922+
"gpt-4o-2024-05-13",
909923
"gpt-4-turbo",
910924
"gpt-4-turbo-2024-04-09",
911925
"gpt-4-0125-preview",
@@ -958,6 +972,8 @@ def create_and_run_stream(
958972
model: Union[
959973
str,
960974
Literal[
975+
"gpt-4o",
976+
"gpt-4o-2024-05-13",
961977
"gpt-4-turbo",
962978
"gpt-4-turbo-2024-04-09",
963979
"gpt-4-0125-preview",
@@ -1241,6 +1257,8 @@ async def create_and_run(
12411257
model: Union[
12421258
str,
12431259
Literal[
1260+
"gpt-4o",
1261+
"gpt-4o-2024-05-13",
12441262
"gpt-4-turbo",
12451263
"gpt-4-turbo-2024-04-09",
12461264
"gpt-4-0125-preview",
@@ -1385,6 +1403,8 @@ async def create_and_run(
13851403
model: Union[
13861404
str,
13871405
Literal[
1406+
"gpt-4o",
1407+
"gpt-4o-2024-05-13",
13881408
"gpt-4-turbo",
13891409
"gpt-4-turbo-2024-04-09",
13901410
"gpt-4-0125-preview",
@@ -1528,6 +1548,8 @@ async def create_and_run(
15281548
model: Union[
15291549
str,
15301550
Literal[
1551+
"gpt-4o",
1552+
"gpt-4o-2024-05-13",
15311553
"gpt-4-turbo",
15321554
"gpt-4-turbo-2024-04-09",
15331555
"gpt-4-0125-preview",
@@ -1670,6 +1692,8 @@ async def create_and_run(
16701692
model: Union[
16711693
str,
16721694
Literal[
1695+
"gpt-4o",
1696+
"gpt-4o-2024-05-13",
16731697
"gpt-4-turbo",
16741698
"gpt-4-turbo-2024-04-09",
16751699
"gpt-4-0125-preview",
@@ -1750,6 +1774,8 @@ async def create_and_run_poll(
17501774
model: Union[
17511775
str,
17521776
Literal[
1777+
"gpt-4o",
1778+
"gpt-4o-2024-05-13",
17531779
"gpt-4-turbo",
17541780
"gpt-4-turbo-2024-04-09",
17551781
"gpt-4-0125-preview",
@@ -1830,6 +1856,8 @@ def create_and_run_stream(
18301856
model: Union[
18311857
str,
18321858
Literal[
1859+
"gpt-4o",
1860+
"gpt-4o-2024-05-13",
18331861
"gpt-4-turbo",
18341862
"gpt-4-turbo-2024-04-09",
18351863
"gpt-4-0125-preview",
@@ -1882,6 +1910,8 @@ def create_and_run_stream(
18821910
model: Union[
18831911
str,
18841912
Literal[
1913+
"gpt-4o",
1914+
"gpt-4o-2024-05-13",
18851915
"gpt-4-turbo",
18861916
"gpt-4-turbo-2024-04-09",
18871917
"gpt-4-0125-preview",
@@ -1934,6 +1964,8 @@ def create_and_run_stream(
19341964
model: Union[
19351965
str,
19361966
Literal[
1967+
"gpt-4o",
1968+
"gpt-4o-2024-05-13",
19371969
"gpt-4-turbo",
19381970
"gpt-4-turbo-2024-04-09",
19391971
"gpt-4-0125-preview",

src/openai/types/beta/assistant_create_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class AssistantCreateParams(TypedDict, total=False):
2222
Union[
2323
str,
2424
Literal[
25+
"gpt-4o",
26+
"gpt-4o-2024-05-13",
2527
"gpt-4-turbo",
2628
"gpt-4-turbo-2024-04-09",
2729
"gpt-4-0125-preview",

src/openai/types/beta/thread_create_and_run_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class ThreadCreateAndRunParamsBase(TypedDict, total=False):
7575
model: Union[
7676
str,
7777
Literal[
78+
"gpt-4o",
79+
"gpt-4o-2024-05-13",
7880
"gpt-4-turbo",
7981
"gpt-4-turbo-2024-04-09",
8082
"gpt-4-0125-preview",

src/openai/types/beta/threads/run_create_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ class RunCreateParamsBase(TypedDict, total=False):
7777
model: Union[
7878
str,
7979
Literal[
80+
"gpt-4o",
81+
"gpt-4o-2024-05-13",
8082
"gpt-4-turbo",
8183
"gpt-4-turbo-2024-04-09",
8284
"gpt-4-0125-preview",

src/openai/types/chat_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
__all__ = ["ChatModel"]
66

77
ChatModel = Literal[
8+
"gpt-4o",
9+
"gpt-4o-2024-05-13",
810
"gpt-4-turbo",
911
"gpt-4-turbo-2024-04-09",
1012
"gpt-4-0125-preview",

0 commit comments

Comments
 (0)