Skip to content

Commit a2f78fe

Browse files
feat: support noise reduction argument for session (#209)
* feat: support noise reduction argument for session * Update packages/agents-realtime/src/clientMessages.ts --------- Co-authored-by: Dominik Kundel <[email protected]>
1 parent d9b94b3 commit a2f78fe

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

.changeset/metal-cases-beg.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+
support noise reduction argument

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ import thinClientExample from '../../../../../../examples/docs/voice-agents/thin
113113
From here you can start designing and building your own voice agent. Voice agents include a lot of the same features as regular agents, but have some of their own unique features.
114114

115115
- Learn how to give your voice agent:
116+
116117
- [Tools](/openai-agents-js/guides/voice-agents/build#tools)
117118
- [Handoffs](/openai-agents-js/guides/voice-agents/build#handoffs)
118119
- [Guardrails](/openai-agents-js/guides/voice-agents/build#guardrails)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ import thinClientExample from '../../../../../../../examples/docs/voice-agents/t
113113
ここからは、独自の音声エージェントの設計と構築を進めましょう。音声エージェントは通常のエージェントと多くの機能を共有していますが、いくつか固有の機能もあります。
114114

115115
- 音声エージェントに以下を追加する方法を学ぶ
116+
116117
- [ツール](/openai-agents-js/ja/guides/voice-agents/build#tools)
117118
- [ハンドオフ](/openai-agents-js/ja/guides/voice-agents/build#handoffs)
118119
- [ガードレール](/openai-agents-js/ja/guides/voice-agents/build#guardrails)

packages/agents-realtime/src/clientMessages.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export type RealtimeTracingConfig =
3333
}
3434
| 'auto';
3535

36+
export type RealtimeInputAudioNoiseReductionConfig = {
37+
type: 'near_field' | 'far_field' | (string & {});
38+
};
39+
3640
export type RealtimeInputAudioTranscriptionConfig = {
3741
language?: string;
3842
model?:
@@ -83,6 +87,7 @@ export type RealtimeSessionConfig = {
8387
tools: FunctionToolDefinition[];
8488
tracing?: RealtimeTracingConfig | null;
8589
providerData?: Record<string, any>;
90+
inputAudioNoiseReduction: RealtimeInputAudioNoiseReductionConfig | null;
8691
speed: number;
8792
};
8893

packages/agents-realtime/src/openaiRealtimeBase.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const DEFAULT_OPENAI_REALTIME_SESSION_CONFIG: Partial<RealtimeSessionConf
6565
turnDetection: {
6666
type: 'semantic_vad',
6767
},
68+
inputAudioNoiseReduction: null,
6869
speed: 1,
6970
};
7071

@@ -393,6 +394,9 @@ export abstract class OpenAIRealtimeBase
393394
input_audio_transcription:
394395
config.inputAudioTranscription ??
395396
DEFAULT_OPENAI_REALTIME_SESSION_CONFIG.inputAudioTranscription,
397+
input_audio_noise_reduction:
398+
config.inputAudioNoiseReduction ??
399+
DEFAULT_OPENAI_REALTIME_SESSION_CONFIG.inputAudioNoiseReduction,
396400
turn_detection:
397401
OpenAIRealtimeBase.buildTurnDetectionConfig(config.turnDetection) ??
398402
DEFAULT_OPENAI_REALTIME_SESSION_CONFIG.turnDetection,

0 commit comments

Comments
 (0)