feat: add CAMB AI tools integration#4457
feat: add CAMB AI tools integration#4457neilruaro-camb wants to merge 2 commits intocrewAIInc:mainfrom
Conversation
Add 9 CAMB AI audio/speech tools: TTS, translation, transcription, translated TTS, voice cloning, voice list, text-to-sound, audio separation, and voice from description.
lib/crewai-tools/src/crewai_tools/tools/camb_ai_tool/camb_ai_tool.py
Outdated
Show resolved
Hide resolved
lib/crewai-tools/src/crewai_tools/tools/camb_ai_tool/tests/test_camb_ai_tool.py
Outdated
Show resolved
Hide resolved
lib/crewai-tools/src/crewai_tools/tools/camb_ai_tool/examples/test_camb_tools.py
Outdated
Show resolved
Hide resolved
lib/crewai-tools/src/crewai_tools/tools/camb_ai_tool/tests/test_camb_ai_tool.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| AUDIO_SAMPLE = os.environ.get("CAMB_AUDIO_SAMPLE") | ||
| if not AUDIO_SAMPLE: | ||
| raise RuntimeError("Set CAMB_AUDIO_SAMPLE environment variable to a local audio file path") | ||
|
|
There was a problem hiding this comment.
Example test file breaks automated collection
Medium Severity
examples/test_camb_tools.py is named like a pytest module and contains import-time checks that raise RuntimeError when CAMB_API_KEY or CAMB_AUDIO_SAMPLE is missing. During normal test discovery, this can fail collection before tests run, even though this file is intended as a manual example.
Additional Locations (1)
| tmp.write(resp.content) | ||
| tmp_path = tmp.name | ||
| with open(tmp_path, "rb") as f: | ||
| kwargs["media_file"] = f |
There was a problem hiding this comment.
Temporary audio files are never cleaned up
Medium Severity
CambTranscriptionTool._run and CambAudioSeparationTool._run write URL downloads to NamedTemporaryFile(delete=False) and never delete them. Repeated calls leave orphaned files in /tmp, causing unbounded disk growth in long-running workers.
Additional Locations (1)
| fmt = _detect_audio_format(resp.content, resp.headers.get("content-type", "")) | ||
| return resp.content, fmt | ||
|
|
||
| return b"", "pcm" |
There was a problem hiding this comment.
Translated TTS can return empty audio silently
Medium Severity
CambTranslatedTTSTool._get_audio falls back to return b"", "pcm" when result fetches fail, and _run then converts this into a WAV and returns a success path/base64. This reports success while producing invalid empty audio instead of signaling failure.


Summary
Add CAMB AI tools integration for crewAI, providing 9 audio/speech tools powered by the CAMB AI platform via
camb-sdk.Tools
CambTTSToolCambTranslationToolCambTranscriptionToolCambTranslatedTTSToolCambVoiceCloneToolCambVoiceListToolCambTextToSoundToolCambAudioSeparationToolCambVoiceFromDescriptionToolAll tools are also available via
CambAIToolkitfor convenient bulk initialization.Changes
lib/crewai-tools/src/crewai_tools/tools/camb_ai_tool/— new tool directory with all 9 toolslib/crewai-tools/src/crewai_tools/tools/__init__.py— register new toolslib/crewai-tools/pyproject.toml— addcamb-sdk>=1.5.0dependencyTesting
All 9 tools tested against the live CAMB AI API. Example usage script included in
camb_ai_tool/examples/.Note
Medium Risk
Adds a large new third-party integration that makes network calls and handles audio files/temporary files; risk is mainly around runtime behavior, dependency compatibility, and API error/timeout handling.
Overview
Adds a new optional
cambintegration powered bycamb-sdk(+httpx) and exposes nine CAMB-backed audio/speech tools (TTS, translation, transcription, translated TTS, voice cloning/listing, voice-from-description, text-to-sound, and audio separation).Registers the new tools in
crewai_tools.tools.__init__and provides aCambAIToolkitfactory that wiresCAMB_API_KEY/config into the selected tools. Includes an example script plus unit tests covering core behaviors like task polling, audio-format detection/WAV wrapping, and API call wiring via mocks.Written by Cursor Bugbot for commit 3827b6c. This will update automatically on new commits. Configure here.