Skip to content

Commit 38ac009

Browse files
feat(api): dev day 2025 launches
DevDay 2025 launches including videos and chatkit beta
1 parent 53f7a74 commit 38ac009

File tree

75 files changed

+4527
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4527
-42
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 123
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fadefdc7c7e30df47c09df323669b242ff90ee08e51f304175ace5274e0aab49.yml
3-
openapi_spec_hash: 6d20f639d9ff8a097a34962da6218231
4-
config_hash: 902654e60f5d659f2bfcfd903e17c46d
1+
configured_endpoints: 136
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-d64cf80d2ebddf175c5578f68226a3d5bbd3f7fd8d62ccac2205f3fc05a355ee.yml
3+
openapi_spec_hash: d51e0d60d0c536f210b597a211bc5af0
4+
config_hash: e7c42016df9c6bd7bd6ff15101b9bc9b

api.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,3 +1139,29 @@ Methods:
11391139
Methods:
11401140

11411141
- <code title="get /containers/{container_id}/files/{file_id}/content">client.containers.files.content.<a href="./src/openai/resources/containers/files/content.py">retrieve</a>(file_id, \*, container_id) -> HttpxBinaryResponseContent</code>
1142+
1143+
# Videos
1144+
1145+
Types:
1146+
1147+
```python
1148+
from openai.types import (
1149+
Video,
1150+
VideoCreateError,
1151+
VideoModel,
1152+
VideoSeconds,
1153+
VideoSize,
1154+
VideoDeleteResponse,
1155+
)
1156+
```
1157+
1158+
Methods:
1159+
1160+
- <code title="post /videos">client.videos.<a href="./src/openai/resources/videos.py">create</a>(\*\*<a href="src/openai/types/video_create_params.py">params</a>) -> <a href="./src/openai/types/video.py">Video</a></code>
1161+
- <code title="get /videos/{video_id}">client.videos.<a href="./src/openai/resources/videos.py">retrieve</a>(video_id) -> <a href="./src/openai/types/video.py">Video</a></code>
1162+
- <code title="get /videos">client.videos.<a href="./src/openai/resources/videos.py">list</a>(\*\*<a href="src/openai/types/video_list_params.py">params</a>) -> <a href="./src/openai/types/video.py">SyncConversationCursorPage[Video]</a></code>
1163+
- <code title="delete /videos/{video_id}">client.videos.<a href="./src/openai/resources/videos.py">delete</a>(video_id) -> <a href="./src/openai/types/video_delete_response.py">VideoDeleteResponse</a></code>
1164+
- <code title="get /videos/{video_id}/content">client.videos.<a href="./src/openai/resources/videos.py">download_content</a>(video_id, \*\*<a href="src/openai/types/video_download_content_params.py">params</a>) -> HttpxBinaryResponseContent</code>
1165+
- <code title="post /videos/{video_id}/remix">client.videos.<a href="./src/openai/resources/videos.py">remix</a>(video_id, \*\*<a href="src/openai/types/video_remix_params.py">params</a>) -> <a href="./src/openai/types/video.py">Video</a></code>
1166+
- <code>client.videos.<a href="./src/openai/resources/videos.py">create_and_poll</a>(\*args) -> Video</code>
1167+

examples/video.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env -S poetry run python
2+
3+
import asyncio
4+
5+
from openai import AsyncOpenAI
6+
7+
client = AsyncOpenAI()
8+
9+
10+
async def main() -> None:
11+
video = await client.videos.create_and_poll(
12+
model="sora-2",
13+
prompt="A video of the words 'Thank you' in sparkling letters",
14+
)
15+
16+
if video.status == "completed":
17+
print("Video successfully completed: ", video)
18+
else:
19+
print("Video creation failed. Status: ", video.status)
20+
21+
22+
asyncio.run(main())

helpers.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,5 @@ client.beta.vector_stores.files.upload_and_poll(...)
514514
client.beta.vector_stores.files.create_and_poll(...)
515515
client.beta.vector_stores.file_batches.create_and_poll(...)
516516
client.beta.vector_stores.file_batches.upload_and_poll(...)
517+
client.videos.create_and_poll(...)
517518
```

src/openai/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ def _reset_client() -> None: # type: ignore[reportUnusedFunction]
379379
files as files,
380380
images as images,
381381
models as models,
382+
videos as videos,
382383
batches as batches,
383384
uploads as uploads,
384385
realtime as realtime,

src/openai/_client.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
files,
4545
images,
4646
models,
47+
videos,
4748
batches,
4849
uploads,
4950
realtime,
@@ -59,6 +60,7 @@
5960
from .resources.files import Files, AsyncFiles
6061
from .resources.images import Images, AsyncImages
6162
from .resources.models import Models, AsyncModels
63+
from .resources.videos import Videos, AsyncVideos
6264
from .resources.batches import Batches, AsyncBatches
6365
from .resources.webhooks import Webhooks, AsyncWebhooks
6466
from .resources.beta.beta import Beta, AsyncBeta
@@ -288,6 +290,12 @@ def containers(self) -> Containers:
288290

289291
return Containers(self)
290292

293+
@cached_property
294+
def videos(self) -> Videos:
295+
from .resources.videos import Videos
296+
297+
return Videos(self)
298+
291299
@cached_property
292300
def with_raw_response(self) -> OpenAIWithRawResponse:
293301
return OpenAIWithRawResponse(self)
@@ -633,6 +641,12 @@ def containers(self) -> AsyncContainers:
633641

634642
return AsyncContainers(self)
635643

644+
@cached_property
645+
def videos(self) -> AsyncVideos:
646+
from .resources.videos import AsyncVideos
647+
648+
return AsyncVideos(self)
649+
636650
@cached_property
637651
def with_raw_response(self) -> AsyncOpenAIWithRawResponse:
638652
return AsyncOpenAIWithRawResponse(self)
@@ -883,6 +897,12 @@ def containers(self) -> containers.ContainersWithRawResponse:
883897

884898
return ContainersWithRawResponse(self._client.containers)
885899

900+
@cached_property
901+
def videos(self) -> videos.VideosWithRawResponse:
902+
from .resources.videos import VideosWithRawResponse
903+
904+
return VideosWithRawResponse(self._client.videos)
905+
886906

887907
class AsyncOpenAIWithRawResponse:
888908
_client: AsyncOpenAI
@@ -998,6 +1018,12 @@ def containers(self) -> containers.AsyncContainersWithRawResponse:
9981018

9991019
return AsyncContainersWithRawResponse(self._client.containers)
10001020

1021+
@cached_property
1022+
def videos(self) -> videos.AsyncVideosWithRawResponse:
1023+
from .resources.videos import AsyncVideosWithRawResponse
1024+
1025+
return AsyncVideosWithRawResponse(self._client.videos)
1026+
10011027

10021028
class OpenAIWithStreamedResponse:
10031029
_client: OpenAI
@@ -1113,6 +1139,12 @@ def containers(self) -> containers.ContainersWithStreamingResponse:
11131139

11141140
return ContainersWithStreamingResponse(self._client.containers)
11151141

1142+
@cached_property
1143+
def videos(self) -> videos.VideosWithStreamingResponse:
1144+
from .resources.videos import VideosWithStreamingResponse
1145+
1146+
return VideosWithStreamingResponse(self._client.videos)
1147+
11161148

11171149
class AsyncOpenAIWithStreamedResponse:
11181150
_client: AsyncOpenAI
@@ -1228,6 +1260,12 @@ def containers(self) -> containers.AsyncContainersWithStreamingResponse:
12281260

12291261
return AsyncContainersWithStreamingResponse(self._client.containers)
12301262

1263+
@cached_property
1264+
def videos(self) -> videos.AsyncVideosWithStreamingResponse:
1265+
from .resources.videos import AsyncVideosWithStreamingResponse
1266+
1267+
return AsyncVideosWithStreamingResponse(self._client.videos)
1268+
12311269

12321270
Client = OpenAI
12331271

src/openai/_module_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .resources.files import Files
1010
from .resources.images import Images
1111
from .resources.models import Models
12+
from .resources.videos import Videos
1213
from .resources.batches import Batches
1314
from .resources.webhooks import Webhooks
1415
from .resources.beta.beta import Beta
@@ -72,6 +73,12 @@ def __load__(self) -> Models:
7273
return _load_client().models
7374

7475

76+
class VideosProxy(LazyProxy["Videos"]):
77+
@override
78+
def __load__(self) -> Videos:
79+
return _load_client().videos
80+
81+
7582
class BatchesProxy(LazyProxy["Batches"]):
7683
@override
7784
def __load__(self) -> Batches:
@@ -151,6 +158,7 @@ def __load__(self) -> Conversations:
151158
evals: Evals = EvalsProxy().__as_proxied__()
152159
images: Images = ImagesProxy().__as_proxied__()
153160
models: Models = ModelsProxy().__as_proxied__()
161+
videos: Videos = VideosProxy().__as_proxied__()
154162
batches: Batches = BatchesProxy().__as_proxied__()
155163
uploads: Uploads = UploadsProxy().__as_proxied__()
156164
webhooks: Webhooks = WebhooksProxy().__as_proxied__()

src/openai/resources/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
ModelsWithStreamingResponse,
5757
AsyncModelsWithStreamingResponse,
5858
)
59+
from .videos import (
60+
Videos,
61+
AsyncVideos,
62+
VideosWithRawResponse,
63+
AsyncVideosWithRawResponse,
64+
VideosWithStreamingResponse,
65+
AsyncVideosWithStreamingResponse,
66+
)
5967
from .batches import (
6068
Batches,
6169
AsyncBatches,
@@ -212,4 +220,10 @@
212220
"AsyncContainersWithRawResponse",
213221
"ContainersWithStreamingResponse",
214222
"AsyncContainersWithStreamingResponse",
223+
"Videos",
224+
"AsyncVideos",
225+
"VideosWithRawResponse",
226+
"AsyncVideosWithRawResponse",
227+
"VideosWithStreamingResponse",
228+
"AsyncVideosWithStreamingResponse",
215229
]

src/openai/resources/beta/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
BetaWithStreamingResponse,
99
AsyncBetaWithStreamingResponse,
1010
)
11+
from .chatkit import (
12+
ChatKit,
13+
AsyncChatKit,
14+
ChatKitWithRawResponse,
15+
AsyncChatKitWithRawResponse,
16+
ChatKitWithStreamingResponse,
17+
AsyncChatKitWithStreamingResponse,
18+
)
1119
from .threads import (
1220
Threads,
1321
AsyncThreads,
@@ -26,6 +34,12 @@
2634
)
2735

2836
__all__ = [
37+
"ChatKit",
38+
"AsyncChatKit",
39+
"ChatKitWithRawResponse",
40+
"AsyncChatKitWithRawResponse",
41+
"ChatKitWithStreamingResponse",
42+
"AsyncChatKitWithStreamingResponse",
2943
"Assistants",
3044
"AsyncAssistants",
3145
"AssistantsWithRawResponse",

src/openai/resources/beta/beta.py

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
AsyncAssistantsWithStreamingResponse,
1313
)
1414
from ..._resource import SyncAPIResource, AsyncAPIResource
15+
from .chatkit.chatkit import (
16+
ChatKit,
17+
AsyncChatKit,
18+
ChatKitWithRawResponse,
19+
AsyncChatKitWithRawResponse,
20+
ChatKitWithStreamingResponse,
21+
AsyncChatKitWithStreamingResponse,
22+
)
1523
from .threads.threads import (
1624
Threads,
1725
AsyncThreads,
@@ -31,14 +39,7 @@
3139

3240
class Beta(SyncAPIResource):
3341
@cached_property
34-
def chat(self) -> Chat:
35-
return Chat(self._client)
36-
37-
@cached_property
38-
def realtime(self) -> Realtime:
39-
return Realtime(self._client)
4042

41-
@cached_property
4243
def assistants(self) -> Assistants:
4344
return Assistants(self._client)
4445

@@ -68,14 +69,7 @@ def with_streaming_response(self) -> BetaWithStreamingResponse:
6869

6970
class AsyncBeta(AsyncAPIResource):
7071
@cached_property
71-
def chat(self) -> AsyncChat:
72-
return AsyncChat(self._client)
7372

74-
@cached_property
75-
def realtime(self) -> AsyncRealtime:
76-
return AsyncRealtime(self._client)
77-
78-
@cached_property
7973
def assistants(self) -> AsyncAssistants:
8074
return AsyncAssistants(self._client)
8175

@@ -107,6 +101,10 @@ class BetaWithRawResponse:
107101
def __init__(self, beta: Beta) -> None:
108102
self._beta = beta
109103

104+
@cached_property
105+
def chatkit(self) -> ChatKitWithRawResponse:
106+
return ChatKitWithRawResponse(self._beta.chatkit)
107+
110108
@cached_property
111109
def assistants(self) -> AssistantsWithRawResponse:
112110
return AssistantsWithRawResponse(self._beta.assistants)
@@ -120,6 +118,10 @@ class AsyncBetaWithRawResponse:
120118
def __init__(self, beta: AsyncBeta) -> None:
121119
self._beta = beta
122120

121+
@cached_property
122+
def chatkit(self) -> AsyncChatKitWithRawResponse:
123+
return AsyncChatKitWithRawResponse(self._beta.chatkit)
124+
123125
@cached_property
124126
def assistants(self) -> AsyncAssistantsWithRawResponse:
125127
return AsyncAssistantsWithRawResponse(self._beta.assistants)
@@ -133,6 +135,10 @@ class BetaWithStreamingResponse:
133135
def __init__(self, beta: Beta) -> None:
134136
self._beta = beta
135137

138+
@cached_property
139+
def chatkit(self) -> ChatKitWithStreamingResponse:
140+
return ChatKitWithStreamingResponse(self._beta.chatkit)
141+
136142
@cached_property
137143
def assistants(self) -> AssistantsWithStreamingResponse:
138144
return AssistantsWithStreamingResponse(self._beta.assistants)
@@ -146,6 +152,10 @@ class AsyncBetaWithStreamingResponse:
146152
def __init__(self, beta: AsyncBeta) -> None:
147153
self._beta = beta
148154

155+
@cached_property
156+
def chatkit(self) -> AsyncChatKitWithStreamingResponse:
157+
return AsyncChatKitWithStreamingResponse(self._beta.chatkit)
158+
149159
@cached_property
150160
def assistants(self) -> AsyncAssistantsWithStreamingResponse:
151161
return AsyncAssistantsWithStreamingResponse(self._beta.assistants)

0 commit comments

Comments
 (0)