Skip to content

Commit f1e2f60

Browse files
feat(realtime): add GA support for Realtime (#402)
1 parent ecea142 commit f1e2f60

Some content is hidden

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

48 files changed

+1702
-351
lines changed

.changeset/sixty-hotels-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openai/agents-realtime': patch
3+
---
4+
5+
Add backgroundResult as an option to return tool results without triggering a new response

.changeset/tiny-maps-begin.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
"@openai/agents-core": patch
3-
"@openai/agents-openai": patch
2+
'@openai/agents-core': patch
3+
'@openai/agents-openai': patch
44
---
55

66
Fix #374 add connector support

.changeset/two-spiders-end.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@openai/agents-extensions': minor
3+
'@openai/agents-realtime': minor
4+
'@openai/agents-core': minor
5+
---
6+
7+
moving realtime to the new GA API and add MCP support

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Before submitting changes, ensure all checks pass:
5757
```bash
5858
pnpm -r build-check
5959
```
60+
NEVER USE `-w` or other watch modes.
6061
- Run the full test suite:
6162
```bash
6263
CI=1 pnpm test

docs/src/content/docs/guides/voice-agents/quickstart.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ import thinClientExample from '../../../../../../examples/docs/voice-agents/thin
4747
As this application will run in the user's browser, we need a secure way to connect to the model through the Realtime API. For this we can use an [ephemeral client key](https://platform.openai.com/docs/guides/realtime#creating-an-ephemeral-token) that should be generated on your backend server. For testing purposes you can also generate a key using `curl` and your regular OpenAI API key.
4848

4949
```bash
50-
curl -X POST https://api.openai.com/v1/realtime/sessions \
50+
curl -X POST https://api.openai.com/v1/realtime/client_secrets \
5151
-H "Authorization: Bearer $OPENAI_API_KEY" \
5252
-H "Content-Type: application/json" \
5353
-d '{
54-
"model": "gpt-4o-realtime-preview-2025-06-03"
54+
"type": "realtime",
55+
"model": "gpt-realtime"
5556
}'
5657
```
5758

@@ -78,7 +79,7 @@ import thinClientExample from '../../../../../../examples/docs/voice-agents/thin
7879
import { RealtimeSession } from '@openai/agents-realtime';
7980

8081
const session = new RealtimeSession(agent, {
81-
model: 'gpt-4o-realtime-preview-2025-06-03',
82+
model: 'gpt-realtime',
8283
});
8384
```
8485

docs/src/content/docs/ja/guides/voice-agents/quickstart.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ import thinClientExample from '../../../../../../../examples/docs/voice-agents/t
4747
このアプリケーションは ユーザー のブラウザで実行されるため、Realtime API を通じてモデルに安全に接続する必要があります。そのために、バックエンド サーバー で生成する [ephemeral client key](https://platform.openai.com/docs/guides/realtime#creating-an-ephemeral-token) を使用できます。テスト目的では、`curl` と通常の OpenAI API キーを使ってキーを生成することもできます。
4848

4949
```bash
50-
curl -X POST https://api.openai.com/v1/realtime/sessions \
50+
curl -X POST https://api.openai.com/v1/realtime/client_secrets \
5151
-H "Authorization: Bearer $OPENAI_API_KEY" \
5252
-H "Content-Type: application/json" \
5353
-d '{
54-
"model": "gpt-4o-realtime-preview-2025-06-03"
54+
"type": "realtime",
55+
"model": "gpt-realtime"
5556
}'
5657
```
5758

@@ -78,7 +79,7 @@ import thinClientExample from '../../../../../../../examples/docs/voice-agents/t
7879
import { RealtimeSession } from '@openai/agents-realtime';
7980

8081
const session = new RealtimeSession(agent, {
81-
model: 'gpt-4o-realtime-preview-2025-06-03',
82+
model: 'gpt-realtime',
8283
});
8384
```
8485

examples/docs/voice-agents/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export const agent = new RealtimeAgent({
55
});
66

77
export const session = new RealtimeSession(agent, {
8-
model: 'gpt-4o-realtime-preview-2025-06-03',
8+
model: 'gpt-realtime',
99
});

examples/docs/voice-agents/configureSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const agent = new RealtimeAgent({
66
});
77

88
const session = new RealtimeSession(agent, {
9-
model: 'gpt-4o-realtime-preview-2025-06-03',
9+
model: 'gpt-realtime',
1010
config: {
1111
inputAudioFormat: 'pcm16',
1212
outputAudioFormat: 'pcm16',

examples/docs/voice-agents/createSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const agent = new RealtimeAgent({
88
async function main() {
99
// define which agent you want to start your session with
1010
const session = new RealtimeSession(agent, {
11-
model: 'gpt-4o-realtime-preview-2025-06-03',
11+
model: 'gpt-realtime',
1212
});
1313
// start your session
1414
await session.connect({ apiKey: '<your api key>' });

examples/docs/voice-agents/sendMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const agent = new RealtimeAgent({
55
});
66

77
const session = new RealtimeSession(agent, {
8-
model: 'gpt-4o-realtime-preview-2025-06-03',
8+
model: 'gpt-realtime',
99
});
1010

1111
session.sendMessage('Hello, how are you?');

0 commit comments

Comments
 (0)