Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/metal-cases-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@openai/agents-realtime': patch
---

support noise reduction argument
1 change: 1 addition & 0 deletions docs/src/content/docs/guides/voice-agents/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ import thinClientExample from '../../../../../../examples/docs/voice-agents/thin
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.

- Learn how to give your voice agent:

- [Tools](/openai-agents-js/guides/voice-agents/build#tools)
- [Handoffs](/openai-agents-js/guides/voice-agents/build#handoffs)
- [Guardrails](/openai-agents-js/guides/voice-agents/build#guardrails)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ import thinClientExample from '../../../../../../../examples/docs/voice-agents/t
ここからは、独自の音声エージェントの設計と構築を進めましょう。音声エージェントは通常のエージェントと多くの機能を共有していますが、いくつか固有の機能もあります。

- 音声エージェントに以下を追加する方法を学ぶ

- [ツール](/openai-agents-js/ja/guides/voice-agents/build#tools)
- [ハンドオフ](/openai-agents-js/ja/guides/voice-agents/build#handoffs)
- [ガードレール](/openai-agents-js/ja/guides/voice-agents/build#guardrails)
Expand Down
5 changes: 5 additions & 0 deletions packages/agents-realtime/src/clientMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export type RealtimeTracingConfig =
}
| 'auto';

export type RealtimeInputAudioNoiseReductionConfig = {
type: 'near_field' | 'far_field';
};

export type RealtimeInputAudioTranscriptionConfig = {
language?: string;
model?:
Expand Down Expand Up @@ -83,6 +87,7 @@ export type RealtimeSessionConfig = {
tools: FunctionToolDefinition[];
tracing?: RealtimeTracingConfig | null;
providerData?: Record<string, any>;
inputAudioNoiseReduction: RealtimeInputAudioNoiseReductionConfig | null;
speed: number;
};

Expand Down
4 changes: 4 additions & 0 deletions packages/agents-realtime/src/openaiRealtimeBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const DEFAULT_OPENAI_REALTIME_SESSION_CONFIG: Partial<RealtimeSessionConf
turnDetection: {
type: 'semantic_vad',
},
inputAudioNoiseReduction: null,
speed: 1,
};

Expand Down Expand Up @@ -393,6 +394,9 @@ export abstract class OpenAIRealtimeBase
input_audio_transcription:
config.inputAudioTranscription ??
DEFAULT_OPENAI_REALTIME_SESSION_CONFIG.inputAudioTranscription,
input_audio_noise_reduction:
config.inputAudioNoiseReduction ??
DEFAULT_OPENAI_REALTIME_SESSION_CONFIG.inputAudioNoiseReduction,
turn_detection:
OpenAIRealtimeBase.buildTurnDetectionConfig(config.turnDetection) ??
DEFAULT_OPENAI_REALTIME_SESSION_CONFIG.turnDetection,
Expand Down