Skip to content

Commit fcdfc80

Browse files
authored
Merge branch 'main' into main
2 parents 491db21 + 74604ba commit fcdfc80

File tree

18 files changed

+226
-88
lines changed

18 files changed

+226
-88
lines changed

.changeset/funny-memes-cover.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+
Correct typo in RealtimeTransportEventTypes in code and docs

.changeset/salty-actors-grin.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+
Fixes issue #106 where overlapping user inputs caused null transcripts in history

docs/src/content/docs/guides/quickstart.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ const historyFunFact = tool({
8585
name: 'history_fun_fact',
8686
// The description is used to describe **when** to use the tool by telling it **what** it does.
8787
description: 'Give a fun fact about a historical event',
88+
// This tool takes no parameters, so we provide an empty Zod Object.
89+
parameters: z.object({}),
8890
execute: async () => {
8991
// The output will be returned back to the Agent to use
9092
return 'Sharks are older than trees.';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Use any recording/playback library to handle the raw PCM16 audio bytes.
4949
### Building your own transport mechanism
5050

5151
If you want to use a different speech-to-speech API or have your own custom transport mechanism, you
52-
can create your own by implementing the `RealtimeTransportLayer` interface and emit the `RealtimeTranportEventTypes` events.
52+
can create your own by implementing the `RealtimeTransportLayer` interface and emit the `RealtimeTransportEventTypes` events.
5353

5454
## Interacting with the Realtime API more directly
5555

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ WebRTC の代わりに WebSocket 接続を使用する場合は、セッショ
4545

4646
### 独自のトランスポートメカニズムの構築
4747

48-
別の speech-to-speech API を使用したい場合や独自のトランスポートメカニズムを持っている場合は、`RealtimeTransportLayer` インターフェースを実装し、`RealtimeTranportEventTypes` イベントを発火することで独自実装が可能です。
48+
別の speech-to-speech API を使用したい場合や独自のトランスポートメカニズムを持っている場合は、`RealtimeTransportLayer` インターフェースを実装し、`RealtimeTransportEventTypes` イベントを発火することで独自実装が可能です。
4949

5050
## Realtime API との直接的なインタラクション
5151

examples/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"class-variance-authority": "^0.7.1",
1717
"clsx": "^2.1.1",
1818
"lucide-react": "^0.515.0",
19-
"next": "15.3.2",
19+
"next": "15.3.3",
2020
"react": "^19.0.0",
2121
"react-dom": "^19.0.0",
2222
"tailwind-merge": "^3.3.1",

examples/nextjs/src/components/History.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function processItems(items: AgentInputItem[]): ProcessedItem[] {
7474
return '';
7575
})
7676
.join('\n') || '⚫︎⚫︎⚫︎',
77-
id: item.id ?? JSON.stringify(item.content),
77+
id: item.id ?? '',
7878
});
7979
}
8080
}
@@ -100,7 +100,7 @@ export function History({ history }: HistoryProps) {
100100
<TextMessage
101101
text={item.content}
102102
isUser={item.role === 'user'}
103-
key={item.id ?? idx}
103+
key={item.id || idx}
104104
/>
105105
);
106106
}

examples/realtime-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@radix-ui/react-slot": "^1.2.3",
1414
"class-variance-authority": "^0.7.1",
1515
"clsx": "^2.1.1",
16-
"next": "15.3.2",
16+
"next": "15.3.3",
1717
"react": "^19.0.0",
1818
"react-dom": "^19.0.0",
1919
"tailwind-merge": "^3.3.0",

packages/agents-core/src/runState.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ const serializedProcessedResponseSchema = z.object({
165165
arguments: z.string().optional(),
166166
status: z.string().optional(),
167167
output: z.string().optional(),
168+
// this always exists but marked as optional for early version compatibility; when releasing 1.0, we can remove the nullable and optional
169+
providerData: z.record(z.string(), z.any()).nullable().optional(),
168170
}),
169171
}),
170172
// HostedMCPTool

packages/agents-core/test/runState.test.ts

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,50 @@ describe('deserialize helpers', () => {
278278
functions: [],
279279
handoffs: [],
280280
computerActions: [{ toolCall: call, computer: tool }],
281-
mcpApprovalRequests: [],
281+
mcpApprovalRequests: [
282+
{
283+
requestItem: {
284+
rawItem: {
285+
type: 'hosted_tool_call',
286+
name: 'fetch_generic_url_content',
287+
status: 'in_progress',
288+
providerData: {
289+
id: 'mcpr_685bc3c47ed88192977549b5206db77504d4306d5de6ab36',
290+
type: 'mcp_approval_request',
291+
arguments:
292+
'{"url":"https://raw.githubusercontent.com/openai/codex/main/README.md"}',
293+
name: 'fetch_generic_url_content',
294+
server_label: 'gitmcp',
295+
},
296+
},
297+
type: 'tool_approval_item',
298+
agent: new Agent({ name: 'foo ' }),
299+
toJSON: function (): any {
300+
throw new Error('Function not implemented.');
301+
},
302+
},
303+
mcpTool: {
304+
type: 'hosted_tool',
305+
name: 'hosted_mcp',
306+
providerData: {
307+
type: 'mcp',
308+
server_label: 'gitmcp',
309+
server_url: 'https://gitmcp.io/openai/codex',
310+
require_approval: {
311+
always: {
312+
tool_names: ['fetch_generic_url_content'],
313+
},
314+
never: {
315+
tool_names: [
316+
'search_codex_code',
317+
'fetch_codex_documentation',
318+
],
319+
},
320+
},
321+
},
322+
},
323+
},
324+
],
282325
toolsUsed: [],
283326
hasToolsOrApprovalsToRun: () => true,
284327
};
@@ -292,5 +335,15 @@ describe('deserialize helpers', () => {
292335
if (restored._currentStep?.type === 'next_step_handoff') {
293336
expect(restored._currentStep.newAgent).toBe(agent);
294337
}
338+
expect(
339+
restored._lastProcessedResponse?.mcpApprovalRequests[0].mcpTool,
340+
).toEqual(state._lastProcessedResponse?.mcpApprovalRequests[0].mcpTool);
341+
expect(
342+
restored._lastProcessedResponse?.mcpApprovalRequests[0].requestItem
343+
.rawItem.providerData,
344+
).toEqual(
345+
state._lastProcessedResponse?.mcpApprovalRequests[0].requestItem.rawItem
346+
.providerData,
347+
);
295348
});
296349
});

0 commit comments

Comments
 (0)