Skip to content

feat: add CAMB AI tools integration#4457

Open
neilruaro-camb wants to merge 2 commits intocrewAIInc:mainfrom
neilruaro-camb:feat/camb-ai-tools
Open

feat: add CAMB AI tools integration#4457
neilruaro-camb wants to merge 2 commits intocrewAIInc:mainfrom
neilruaro-camb:feat/camb-ai-tools

Conversation

@neilruaro-camb
Copy link

@neilruaro-camb neilruaro-camb commented Feb 11, 2026

Summary

Add CAMB AI tools integration for crewAI, providing 9 audio/speech tools powered by the CAMB AI platform via camb-sdk.

Tools

Tool Description
CambTTSTool Text-to-speech synthesis
CambTranslationTool Text translation between 140+ languages
CambTranscriptionTool Audio transcription with speaker diarization
CambTranslatedTTSTool Translate text and generate speech in one step
CambVoiceCloneTool Clone a voice from an audio sample
CambVoiceListTool List available voices
CambTextToSoundTool Generate sound effects or music from a text prompt
CambAudioSeparationTool Separate vocals from background audio
CambVoiceFromDescriptionTool Generate a synthetic voice from a text description

All tools are also available via CambAIToolkit for convenient bulk initialization.

Changes

  • lib/crewai-tools/src/crewai_tools/tools/camb_ai_tool/ — new tool directory with all 9 tools
  • lib/crewai-tools/src/crewai_tools/tools/__init__.py — register new tools
  • lib/crewai-tools/pyproject.toml — add camb-sdk>=1.5.0 dependency

Testing

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 camb integration powered by camb-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 a CambAIToolkit factory that wires CAMB_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.

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.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

tmp.write(resp.content)
tmp_path = tmp.name
with open(tmp_path, "rb") as f:
kwargs["media_file"] = f
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Cursor Fix in Web

fmt = _detect_audio_format(resp.content, resp.headers.get("content-type", ""))
return resp.content, fmt

return b"", "pcm"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants