Skip to content

Commit 758f914

Browse files
authored
Merge branch 'main' into fix-pdf-upload
2 parents 38ae1a2 + 4756247 commit 758f914

File tree

280 files changed

+9670
-957
lines changed

Some content is hidden

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

280 files changed

+9670
-957
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
permissions:
4343
contents: read
4444
id-token: write
45-
runs-on: depot-ubuntu-24.04
45+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
4646
steps:
4747
- uses: actions/checkout@v4
4848

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.101.0"
2+
".": "1.107.2"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 119
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-ddbdf9343316047e8a773c54fb24e4a8d225955e202a1888fde6f9c8898ebf98.yml
3-
openapi_spec_hash: 9802f6dd381558466c897f6e387e06ca
4-
config_hash: fe0ea26680ac2075a6cd66416aefe7db
1+
configured_endpoints: 118
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-94b1e3cb0bdc616ff0c2f267c33dadd95f133b1f64e647aab6c64afb292b2793.yml
3+
openapi_spec_hash: 2395319ac9befd59b6536ae7f9564a05
4+
config_hash: 930dac3aa861344867e4ac84f037b5df

CHANGELOG.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,137 @@
11
# Changelog
22

3+
## 1.107.2 (2025-09-12)
4+
5+
Full Changelog: [v1.107.1...v1.107.2](https://github.com/openai/openai-python/compare/v1.107.1...v1.107.2)
6+
7+
### Chores
8+
9+
* **api:** Minor docs and type updates for realtime ([ab6a10d](https://github.com/openai/openai-python/commit/ab6a10da4ed7e6386695b6f5f29149d4870f85c9))
10+
* **tests:** simplify `get_platform` test ([01f03e0](https://github.com/openai/openai-python/commit/01f03e0ad1f9ab3f2ed8b7c13d652263c6d06378))
11+
12+
## 1.107.1 (2025-09-10)
13+
14+
Full Changelog: [v1.107.0...v1.107.1](https://github.com/openai/openai-python/compare/v1.107.0...v1.107.1)
15+
16+
### Chores
17+
18+
* **api:** fix realtime GA types ([570fc5a](https://github.com/openai/openai-python/commit/570fc5a28ada665fd658b24675361680cfeb086f))
19+
20+
## 1.107.0 (2025-09-08)
21+
22+
Full Changelog: [v1.106.1...v1.107.0](https://github.com/openai/openai-python/compare/v1.106.1...v1.107.0)
23+
24+
### Features
25+
26+
* **api:** ship the RealtimeGA API shape ([dc319d8](https://github.com/openai/openai-python/commit/dc319d8bbb3a20108399c1d15f98e63bdd84eb5c))
27+
28+
29+
### Chores
30+
31+
* **internal:** codegen related update ([b79b7ca](https://github.com/openai/openai-python/commit/b79b7ca3a72009a036db0a344b500f616ca0443f))
32+
33+
## 1.106.1 (2025-09-04)
34+
35+
Full Changelog: [v1.106.0...v1.106.1](https://github.com/openai/openai-python/compare/v1.106.0...v1.106.1)
36+
37+
### Chores
38+
39+
* **internal:** move mypy configurations to `pyproject.toml` file ([ca413a2](https://github.com/openai/openai-python/commit/ca413a277496c3b883b103ad1138a886e89ae15e))
40+
41+
## 1.106.0 (2025-09-04)
42+
43+
Full Changelog: [v1.105.0...v1.106.0](https://github.com/openai/openai-python/compare/v1.105.0...v1.106.0)
44+
45+
### Features
46+
47+
* **client:** support callable api_key ([#2588](https://github.com/openai/openai-python/issues/2588)) ([e1bad01](https://github.com/openai/openai-python/commit/e1bad015b8a2b98bfee955a24bc931347a58efc1))
48+
* improve future compat with pydantic v3 ([6645d93](https://github.com/openai/openai-python/commit/6645d9317a240982928b92c2f4af0381db6edc09))
49+
50+
## 1.105.0 (2025-09-03)
51+
52+
Full Changelog: [v1.104.2...v1.105.0](https://github.com/openai/openai-python/compare/v1.104.2...v1.105.0)
53+
54+
### Features
55+
56+
* **api:** Add gpt-realtime models ([8502041](https://github.com/openai/openai-python/commit/85020414808314df9cb42e020b11baff12f18f16))
57+
58+
## 1.104.2 (2025-09-02)
59+
60+
Full Changelog: [v1.104.1...v1.104.2](https://github.com/openai/openai-python/compare/v1.104.1...v1.104.2)
61+
62+
### Bug Fixes
63+
64+
* **types:** add aliases back for web search tool types ([2521cd8](https://github.com/openai/openai-python/commit/2521cd8445906e418dbae783b0d7c375ad91d49d))
65+
66+
## 1.104.1 (2025-09-02)
67+
68+
Full Changelog: [v1.104.0...v1.104.1](https://github.com/openai/openai-python/compare/v1.104.0...v1.104.1)
69+
70+
### Chores
71+
72+
* **api:** manual updates for ResponseInputAudio ([0db5061](https://github.com/openai/openai-python/commit/0db50619663656ba97bba30ab640bbb33683d196))
73+
74+
## 1.104.0 (2025-09-02)
75+
76+
Full Changelog: [v1.103.0...v1.104.0](https://github.com/openai/openai-python/compare/v1.103.0...v1.104.0)
77+
78+
### Features
79+
80+
* **types:** replace List[str] with SequenceNotStr in params ([bc00bda](https://github.com/openai/openai-python/commit/bc00bda880a80089be8a1758c016266ca72dab2c))
81+
82+
83+
### Bug Fixes
84+
85+
* **types:** update more types to use SequenceNotStr ([cff135c](https://github.com/openai/openai-python/commit/cff135cb7059ef1bf8f9b101a83529fc0cee37c4))
86+
* **types:** update some types to SequenceNotStr ([03f8b88](https://github.com/openai/openai-python/commit/03f8b88a0d428b74a7822e678a60d0ef106ea961))
87+
88+
89+
### Chores
90+
91+
* remove unused import ([ac7795b](https://github.com/openai/openai-python/commit/ac7795b50d956ec5dc468302e8e3579a0467edcb))
92+
93+
## 1.103.0 (2025-09-02)
94+
95+
Full Changelog: [v1.102.0...v1.103.0](https://github.com/openai/openai-python/compare/v1.102.0...v1.103.0)
96+
97+
### Features
98+
99+
* **api:** realtime API updates ([b7c2ddc](https://github.com/openai/openai-python/commit/b7c2ddc5e5dedda01015b3d0e14ea6eb68c282d3))
100+
101+
102+
### Bug Fixes
103+
104+
* **responses:** add missing params to stream() method ([bfc0673](https://github.com/openai/openai-python/commit/bfc06732ffe3764cb95cef9f23b4b5c0d312826a))
105+
106+
107+
### Chores
108+
109+
* bump `inline-snapshot` version to 0.28.0 ([#2590](https://github.com/openai/openai-python/issues/2590)) ([a6b0872](https://github.com/openai/openai-python/commit/a6b087226587d4cc4f59f1f09a595921b2823ef2))
110+
* **client:** format imports ([7ae3020](https://github.com/openai/openai-python/commit/7ae3020b3ca7de21e6e9a0a1c40908e655f6cad5))
111+
* **internal:** add Sequence related utils ([d3d72b9](https://github.com/openai/openai-python/commit/d3d72b9ce3c0885bf2b6934ac57d9e84f8653208))
112+
* **internal:** fix formatting ([3ab273f](https://github.com/openai/openai-python/commit/3ab273f21e601f088be7502b7bb5d249fc386d6a))
113+
* **internal:** minor formatting change ([478a348](https://github.com/openai/openai-python/commit/478a34881c968e9cab9d93ac2cf8da2fcb37c46c))
114+
* **internal:** update pyright exclude list ([66e440f](https://github.com/openai/openai-python/commit/66e440fac3ca388400392c64211450dedc491c11))
115+
116+
## 1.102.0 (2025-08-26)
117+
118+
Full Changelog: [v1.101.0...v1.102.0](https://github.com/openai/openai-python/compare/v1.101.0...v1.102.0)
119+
120+
### Features
121+
122+
* **api:** add web search filters ([1c199a8](https://github.com/openai/openai-python/commit/1c199a8dc85f773ae656fe850fdfb80b91f8f6b1))
123+
124+
125+
### Bug Fixes
126+
127+
* avoid newer type syntax ([bd0c668](https://github.com/openai/openai-python/commit/bd0c668d754b89c78c2c9ad2e081258c04aaece6))
128+
129+
130+
### Chores
131+
132+
* **internal:** change ci workflow machines ([3e129d5](https://github.com/openai/openai-python/commit/3e129d5e49f6391dea7497132cb3cfed8e5dd8ee))
133+
* **internal:** codegen related update ([b6dc170](https://github.com/openai/openai-python/commit/b6dc170832d719fc5028cfe234748c22e6e168aa))
134+
3135
## 1.101.0 (2025-08-21)
4136

5137
Full Changelog: [v1.100.3...v1.101.0](https://github.com/openai/openai-python/compare/v1.100.3...v1.101.0)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ async def main():
226226
asyncio.run(main())
227227
```
228228

229-
## Realtime API beta
229+
## Realtime API
230230

231231
The Realtime API enables you to build low-latency, multi-modal conversational experiences. It currently supports text and audio as both input and output, as well as [function calling](https://platform.openai.com/docs/guides/function-calling) through a WebSocket connection.
232232

@@ -243,7 +243,7 @@ from openai import AsyncOpenAI
243243
async def main():
244244
client = AsyncOpenAI()
245245

246-
async with client.beta.realtime.connect(model="gpt-4o-realtime-preview") as connection:
246+
async with client.realtime.connect(model="gpt-realtime") as connection:
247247
await connection.session.update(session={'modalities': ['text']})
248248

249249
await connection.conversation.item.create(
@@ -277,7 +277,7 @@ Whenever an error occurs, the Realtime API will send an [`error` event](https://
277277
```py
278278
client = AsyncOpenAI()
279279

280-
async with client.beta.realtime.connect(model="gpt-4o-realtime-preview") as connection:
280+
async with client.realtime.connect(model="gpt-realtime") as connection:
281281
...
282282
async for event in connection:
283283
if event.type == 'error':

api.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ from openai.types.webhooks import (
431431
FineTuningJobCancelledWebhookEvent,
432432
FineTuningJobFailedWebhookEvent,
433433
FineTuningJobSucceededWebhookEvent,
434+
RealtimeCallIncomingWebhookEvent,
434435
ResponseCancelledWebhookEvent,
435436
ResponseCompletedWebhookEvent,
436437
ResponseFailedWebhookEvent,
@@ -832,6 +833,7 @@ from openai.types.responses import (
832833
ToolChoiceMcp,
833834
ToolChoiceOptions,
834835
ToolChoiceTypes,
836+
WebSearchPreviewTool,
835837
WebSearchTool,
836838
)
837839
```
@@ -855,6 +857,133 @@ Methods:
855857

856858
- <code title="get /responses/{response_id}/input_items">client.responses.input_items.<a href="./src/openai/resources/responses/input_items.py">list</a>(response_id, \*\*<a href="src/openai/types/responses/input_item_list_params.py">params</a>) -> <a href="./src/openai/types/responses/response_item.py">SyncCursorPage[ResponseItem]</a></code>
857859

860+
# Realtime
861+
862+
Types:
863+
864+
```python
865+
from openai.types.realtime import (
866+
AudioTranscription,
867+
ConversationCreatedEvent,
868+
ConversationItem,
869+
ConversationItemAdded,
870+
ConversationItemCreateEvent,
871+
ConversationItemCreatedEvent,
872+
ConversationItemDeleteEvent,
873+
ConversationItemDeletedEvent,
874+
ConversationItemDone,
875+
ConversationItemInputAudioTranscriptionCompletedEvent,
876+
ConversationItemInputAudioTranscriptionDeltaEvent,
877+
ConversationItemInputAudioTranscriptionFailedEvent,
878+
ConversationItemInputAudioTranscriptionSegment,
879+
ConversationItemRetrieveEvent,
880+
ConversationItemTruncateEvent,
881+
ConversationItemTruncatedEvent,
882+
ConversationItemWithReference,
883+
InputAudioBufferAppendEvent,
884+
InputAudioBufferClearEvent,
885+
InputAudioBufferClearedEvent,
886+
InputAudioBufferCommitEvent,
887+
InputAudioBufferCommittedEvent,
888+
InputAudioBufferSpeechStartedEvent,
889+
InputAudioBufferSpeechStoppedEvent,
890+
InputAudioBufferTimeoutTriggered,
891+
LogProbProperties,
892+
McpListToolsCompleted,
893+
McpListToolsFailed,
894+
McpListToolsInProgress,
895+
NoiseReductionType,
896+
OutputAudioBufferClearEvent,
897+
RateLimitsUpdatedEvent,
898+
RealtimeAudioConfig,
899+
RealtimeAudioConfigInput,
900+
RealtimeAudioConfigOutput,
901+
RealtimeAudioFormats,
902+
RealtimeAudioInputTurnDetection,
903+
RealtimeClientEvent,
904+
RealtimeConversationItemAssistantMessage,
905+
RealtimeConversationItemFunctionCall,
906+
RealtimeConversationItemFunctionCallOutput,
907+
RealtimeConversationItemSystemMessage,
908+
RealtimeConversationItemUserMessage,
909+
RealtimeError,
910+
RealtimeErrorEvent,
911+
RealtimeFunctionTool,
912+
RealtimeMcpApprovalRequest,
913+
RealtimeMcpApprovalResponse,
914+
RealtimeMcpListTools,
915+
RealtimeMcpProtocolError,
916+
RealtimeMcpToolCall,
917+
RealtimeMcpToolExecutionError,
918+
RealtimeMcphttpError,
919+
RealtimeResponse,
920+
RealtimeResponseCreateAudioOutput,
921+
RealtimeResponseCreateMcpTool,
922+
RealtimeResponseCreateParams,
923+
RealtimeResponseStatus,
924+
RealtimeResponseUsage,
925+
RealtimeResponseUsageInputTokenDetails,
926+
RealtimeResponseUsageOutputTokenDetails,
927+
RealtimeServerEvent,
928+
RealtimeSession,
929+
RealtimeSessionCreateRequest,
930+
RealtimeToolChoiceConfig,
931+
RealtimeToolsConfig,
932+
RealtimeToolsConfigUnion,
933+
RealtimeTracingConfig,
934+
RealtimeTranscriptionSessionAudio,
935+
RealtimeTranscriptionSessionAudioInput,
936+
RealtimeTranscriptionSessionAudioInputTurnDetection,
937+
RealtimeTranscriptionSessionCreateRequest,
938+
RealtimeTruncation,
939+
RealtimeTruncationRetentionRatio,
940+
ResponseAudioDeltaEvent,
941+
ResponseAudioDoneEvent,
942+
ResponseAudioTranscriptDeltaEvent,
943+
ResponseAudioTranscriptDoneEvent,
944+
ResponseCancelEvent,
945+
ResponseContentPartAddedEvent,
946+
ResponseContentPartDoneEvent,
947+
ResponseCreateEvent,
948+
ResponseCreatedEvent,
949+
ResponseDoneEvent,
950+
ResponseFunctionCallArgumentsDeltaEvent,
951+
ResponseFunctionCallArgumentsDoneEvent,
952+
ResponseMcpCallArgumentsDelta,
953+
ResponseMcpCallArgumentsDone,
954+
ResponseMcpCallCompleted,
955+
ResponseMcpCallFailed,
956+
ResponseMcpCallInProgress,
957+
ResponseOutputItemAddedEvent,
958+
ResponseOutputItemDoneEvent,
959+
ResponseTextDeltaEvent,
960+
ResponseTextDoneEvent,
961+
SessionCreatedEvent,
962+
SessionUpdateEvent,
963+
SessionUpdatedEvent,
964+
TranscriptionSessionUpdate,
965+
TranscriptionSessionUpdatedEvent,
966+
)
967+
```
968+
969+
## ClientSecrets
970+
971+
Types:
972+
973+
```python
974+
from openai.types.realtime import (
975+
RealtimeSessionClientSecret,
976+
RealtimeSessionCreateResponse,
977+
RealtimeTranscriptionSessionCreateResponse,
978+
RealtimeTranscriptionSessionTurnDetection,
979+
ClientSecretCreateResponse,
980+
)
981+
```
982+
983+
Methods:
984+
985+
- <code title="post /realtime/client_secrets">client.realtime.client_secrets.<a href="./src/openai/resources/realtime/client_secrets.py">create</a>(\*\*<a href="src/openai/types/realtime/client_secret_create_params.py">params</a>) -> <a href="./src/openai/types/realtime/client_secret_create_response.py">ClientSecretCreateResponse</a></code>
986+
858987
# Conversations
859988

860989
Types:

examples/realtime/audio_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import sounddevice as sd
1212
from pydub import AudioSegment
1313

14-
from openai.resources.beta.realtime.realtime import AsyncRealtimeConnection
14+
from openai.resources.realtime.realtime import AsyncRealtimeConnection
1515

1616
CHUNK_LENGTH_S = 0.05 # 100ms
1717
SAMPLE_RATE = 24000

examples/realtime/azure_realtime.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ async def main() -> None:
2626
azure_ad_token_provider=get_bearer_token_provider(credential, "https://cognitiveservices.azure.com/.default"),
2727
api_version="2024-10-01-preview",
2828
)
29-
async with client.beta.realtime.connect(
30-
model="gpt-4o-realtime-preview", # deployment name for your model
29+
async with client.realtime.connect(
30+
model="gpt-realtime", # deployment name for your model
3131
) as connection:
32-
await connection.session.update(session={"modalities": ["text"]}) # type: ignore
32+
await connection.session.update(
33+
session={
34+
"output_modalities": ["text"],
35+
"model": "gpt-realtime",
36+
"type": "realtime",
37+
}
38+
)
3339
while True:
3440
user_input = input("Enter a message: ")
3541
if user_input == "q":
@@ -44,9 +50,9 @@ async def main() -> None:
4450
)
4551
await connection.response.create()
4652
async for event in connection:
47-
if event.type == "response.text.delta":
53+
if event.type == "response.output_text.delta":
4854
print(event.delta, flush=True, end="")
49-
elif event.type == "response.text.done":
55+
elif event.type == "response.output_text.done":
5056
print()
5157
elif event.type == "response.done":
5258
break

0 commit comments

Comments
 (0)