Skip to content

[Example] 310 — CrewAI Voice-Enabled Multi-Agent System (Python)#126

Merged
lukeocodes merged 3 commits intomainfrom
example/260-crewai-voice-agents-python
Apr 2, 2026
Merged

[Example] 310 — CrewAI Voice-Enabled Multi-Agent System (Python)#126
lukeocodes merged 3 commits intomainfrom
example/260-crewai-voice-agents-python

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 2, 2026

New example: CrewAI Voice-Enabled Multi-Agent System (Python)

Integration: CrewAI | Language: Python | Products: STT, TTS

What this shows

A three-agent CrewAI crew with voice I/O powered by Deepgram. A Voice Listener agent transcribes audio with Deepgram STT (nova-3), a Research Analyst agent extracts key insights from the transcript, and a Voice Speaker agent delivers the analysis as spoken audio via Deepgram TTS (aura-2). Demonstrates voice-in/voice-out multi-agent coordination using CrewAI's sequential process.

Required secrets

  • DEEPGRAM_API_KEY — Deepgram console
  • OPENAI_API_KEY — OpenAI dashboard (CrewAI LLM backend)

Built by Engineer on 2026-04-02

@github-actions github-actions bot added type:example New example language:python Language: Python integration:crewai Integration: CrewAI labels Apr 2, 2026
@github-actions github-actions bot added type:example New example language:python Language: Python integration:crewai Integration: CrewAI labels Apr 2, 2026
@lukeocodes lukeocodes changed the title [Example] 260 — CrewAI Voice-Enabled Multi-Agent System (Python) [Example] 310 — CrewAI Voice-Enabled Multi-Agent System (Python) Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 2, 2026

Code Review

Overall: CHANGES REQUESTED

Tests ran ❌

tests/test_example.py::test_deepgram_stt PASSED
tests/test_example.py::test_deepgram_tts FAILED
tests/test_example.py::test_crewai_tools_importable PASSED
tests/test_example.py::test_crewai_crew_builds PASSED

FAILED tests/test_example.py::test_deepgram_tts - AttributeError: 'V1Client' object has no attribute 'media'
1 failed, 3 passed in 4.52s

Integration genuineness

Pass — CrewAI SDK is imported and used to build a real three-agent sequential crew. .env.example lists OPENAI_API_KEY (CrewAI LLM backend) alongside DEEPGRAM_API_KEY. Tests exit with code 2 when credentials are missing.

Code quality

  1. TTS API path is wrong (test failure)client.speak.v1.media.save(...) does not exist in deepgram-sdk==v6.1.1. The speak client exposes client.speak.v1.audio.generate(...) which returns an Iterator[bytes]. Both src/crew.py:85 and tests/test_example.py:54 use the nonexistent .media.save() path. This must be fixed for TTS to work at all.

  2. Word-list transcript assertion is flakytests/test_example.py:40-42 asserts specific keywords ["spacewalk", "astronaut", "nasa"]. Transcription is non-deterministic; these assertions should use length/duration proportionality instead of word lists (e.g., assert transcript length is proportional to audio duration).

  3. Credential check runs after SDK imports in crew.pysrc/crew.py imports crewai and deepgram at module top (lines 25-27) before the credential check in main() (lines 200-208). If the SDK import itself fails or triggers an API call, users get a confusing error instead of the helpful "set your key" message. Move credential check before SDK imports (the test file already does this correctly).

  4. Unused importurllib.request is imported at src/crew.py:18 but never used.

Documentation

README is well-structured: "What you'll build" section present, env vars table with links, install/run instructions, architecture diagram. .env.example is present and complete.


Please address the items above. The fix agent will pick this up.


Review by Lead on 2026-04-02

@github-actions github-actions bot added the status:fix-needed Tests failing — fix agent queued label Apr 2, 2026
…oice-agents-python

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 2, 2026

Fix applied

Root cause: client.speak.v1.media.save() does not exist in deepgram-sdk==v6.1.1 — the speak V1Client has .audio (with .generate()) but no .media sub-client.

Change:

  • Replaced client.speak.v1.media.save(...) with client.speak.v1.audio.generate(...) + manual file write in both src/crew.py and tests/test_example.py
  • Replaced word-list transcript assertion (["spacewalk", "astronaut", "nasa"]) with duration-proportionality check
  • Moved credential checks before SDK imports in crew.py so users get a clear error message
  • Removed unused urllib.request import

The lead reviewer will re-run tests and review on the next sweep.


Fix by Lead on 2026-04-02

@github-actions github-actions bot removed the status:fix-needed Tests failing — fix agent queued label Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 2, 2026

Code Review

Overall: APPROVED

Tests ran ✅

tests/test_example.py::test_deepgram_stt PASSED
  pass: Deepgram STT integration working
  Transcript preview: 'Yeah. As as much as, it's worth celebrating, the first, spacewalk, with an all f...'

tests/test_example.py::test_deepgram_tts PASSED
  pass: Deepgram TTS integration working
  Generated 142124 bytes of audio

tests/test_example.py::test_crewai_tools_importable PASSED
  pass: CrewAI tool definitions valid
  Tools: transcribe_audio, speak_text

tests/test_example.py::test_crewai_crew_builds PASSED
  pass: CrewAI crew builds correctly
  Agents: Voice Listener, Research Analyst, Voice Speaker

======================== 4 passed, 5 warnings in 5.43s =========================

Integration genuineness

Pass — CrewAI SDK is imported (from crewai import Agent, Crew, Process, Task) and used to build a real 3-agent sequential crew. OpenAI is used as the LLM backend (required by CrewAI). .env.example lists both DEEPGRAM_API_KEY and OPENAI_API_KEY. Tests exit with code 2 when credentials are missing, and make real API calls when present.

Code quality

  • ✅ Official Deepgram SDK (deepgram-sdk==v6.1.1 — matches required version)
  • tag="deepgram-examples" on all 5 Deepgram API calls (STT URL, STT file, TTS in src; STT and TTS in tests)
  • ✅ No hardcoded credentials
  • ✅ Error handling: credential checks at module level before SDK imports (crew.py:24-32)
  • ✅ Transcript assertions use length/duration proportionality — no specific word lists
  • .env.example present and complete
  • ✅ Credential check runs FIRST (lines 24-32) before any SDK imports (line 34-36)

Documentation

  • ✅ README includes "What you'll build", env var table with where-to-get links, install/run instructions
  • ✅ Architecture diagram and key parameters table are a nice touch
  • .env.example has comments with links to credential sources

✓ All checks pass. Ready for merge.


Review by Lead on 2026-04-02

@github-actions github-actions bot added the status:review-passed Self-review passed label Apr 2, 2026
@lukeocodes lukeocodes merged commit 3672207 into main Apr 2, 2026
1 check passed
@lukeocodes lukeocodes deleted the example/260-crewai-voice-agents-python branch April 2, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:crewai Integration: CrewAI language:python Language: Python status:review-passed Self-review passed type:example New example

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant