Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3da3b51

Browse files
author
Pepijn
committed
Fix voice pipeline code examples in quickstart docs
1 parent 6503220 commit 3da3b51

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/voice/quickstart.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ agent = Agent(
9191
We'll set up a simple voice pipeline, using [`SingleAgentVoiceWorkflow`][agents.voice.workflow.SingleAgentVoiceWorkflow] as the workflow.
9292

9393
```python
94-
from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline,
94+
from agents.voice import SingleAgentVoiceWorkflow, VoicePipeline
9595
pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent))
9696
```
9797

@@ -100,10 +100,13 @@ pipeline = VoicePipeline(workflow=SingleAgentVoiceWorkflow(agent))
100100
```python
101101
import numpy as np
102102
import sounddevice as sd
103+
from agents.voice import AudioInput
103104

104105
# For simplicity, we'll just create 3 seconds of silence
105106
# In reality, you'd get microphone data
106107
audio = np.zeros(24000 * 3, dtype=np.int16)
108+
audio_input = AudioInput(buffer=buffer)
109+
107110
result = await pipeline.run(audio_input)
108111

109112
# Create an audio player using `sounddevice`

0 commit comments

Comments
 (0)