From 3da3b51b872495cb29f78c0496157c3121e13671 Mon Sep 17 00:00:00 2001 From: Pepijn <> Date: Fri, 21 Mar 2025 06:47:12 +0100 Subject: [PATCH] Fix voice pipeline code examples in quickstart docs --- docs/voice/quickstart.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/voice/quickstart.md b/docs/voice/quickstart.md index 1b96d0c68..a9513f4f8 100644 --- a/docs/voice/quickstart.md +++ b/docs/voice/quickstart.md @@ -91,7 +91,7 @@ agent = Agent( We'll set up a simple voice pipeline, using [`SingleAgentVoiceWorkflow`][agents.voice.workflow.SingleAgentVoiceWorkflow] as the workflow. ```python -from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline, +from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent)) ``` @@ -100,10 +100,13 @@ pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent)) ```python import numpy as np import sounddevice as sd +from agents.voice import AudioInput # For simplicity, we'll just create 3 seconds of silence # In reality, you'd get microphone data audio = np.zeros(24000 * 3, dtype=np.int16) +audio_input = AudioInput(buffer=buffer) + result = await pipeline.run(audio_input) # Create an audio player using `sounddevice`