Skip to content

Comments

feat(tools): add CAMB AI integration#4599

Open
neilruaro-camb wants to merge 1 commit intogoogle:mainfrom
neilruaro-camb:feat/camb-ai-tools
Open

feat(tools): add CAMB AI integration#4599
neilruaro-camb wants to merge 1 commit intogoogle:mainfrom
neilruaro-camb:feat/camb-ai-tools

Conversation

@neilruaro-camb
Copy link

Summary

  • Adds CambAIToolset providing 8 audio/speech tools powered by camb.ai: TTS, translation, transcription, translated TTS, voice cloning, voice listing, text-to-sound, and audio separation
  • Installs via optional dependency: pip install google-adk[camb]
  • Follows existing toolset conventions (lazy imports, BaseToolset, FunctionTool wrapping, optional dep group)

Usage

from google.adk.tools.camb import CambAIToolset

toolset = CambAIToolset(api_key="your-key")
agent = Agent(
    name="audio_agent",
    model="gemini-2.0-flash",
    tools=[toolset],
)

Testing plan

Unit tests (52 passing):

pytest tests/unittests/tools/camb/test_camb_tools.py -v
======================== 52 passed in 1.10s =========================

Live integration tests against CAMB AI API: all 8 tools verified (TTS, translation, voice list, transcription, translated TTS, text-to-sound, voice clone, audio separation).

@google-cla
Copy link

google-cla bot commented Feb 24, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @neilruaro-camb, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the audio and speech processing capabilities of the Google ADK by integrating the CAMB AI platform. It introduces a new toolset that allows agents to perform a wide range of audio-related tasks, from generating speech and translating audio to cloning voices and separating audio tracks. The implementation ensures that these powerful new features are modular and can be optionally included, maintaining the ADK's flexibility and performance.

Highlights

  • New Toolset Integration: Added CambAIToolset, providing 8 audio/speech tools powered by camb.ai: Text-to-Speech (TTS), translation, transcription, translated TTS, voice cloning, voice listing, text-to-sound, and audio separation.
  • Optional Dependency: The camb SDK is now an optional dependency, installable via pip install google-adk[camb].
  • Architectural Adherence: The new toolset follows existing ADK toolset conventions, including lazy imports, inheriting from BaseToolset, wrapping functions with FunctionTool, and utilizing an optional dependency group.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • pyproject.toml
    • Added camb as an optional dependency group, requiring camb-sdk>=1.0.0.
  • src/google/adk/tools/init.py
    • Imported CambAIToolset from the new camb module.
    • Added CambAIToolset to the _LAZY_MAPPING dictionary for lazy loading.
  • src/google/adk/tools/camb/init.py
    • Created a new package for CAMB AI tools.
    • Defined the CambAIToolset as part of the package's public API.
  • src/google/adk/tools/camb/_helpers.py
    • Created a new module containing shared helper utilities for CAMB AI tools.
    • Implemented lazy client initialization, async polling, audio format detection, WAV header addition, audio file saving, and result formatting functions.
  • src/google/adk/tools/camb/_tools.py
    • Created a new module containing factory functions for each of the 8 CAMB AI tools.
    • Each factory returns an async function suitable for wrapping by FunctionTool.
  • src/google/adk/tools/camb/camb_toolset.py
    • Created the CambAIToolset class, inheriting from BaseToolset.
    • Initialized CambHelpers and conditionally added FunctionTool instances for each enabled CAMB AI service.
  • tests/unittests/tools/camb/test_camb_tools.py
    • Added a new comprehensive unit test file for the CambAIToolset and its helper functions.
    • Included tests for CambHelpers utilities, async polling, and mocked tests for each of the 8 CAMB AI tool functions.
Activity
  • Unit tests were executed, with 52 tests passing successfully.
  • Live integration tests were performed against the CAMB AI API, verifying the functionality of all 8 tools (TTS, translation, voice list, transcription, translated TTS, text-to-sound, voice clone, audio separation).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@adk-bot adk-bot added the tools [Component] This issue is related to tools label Feb 24, 2026
@adk-bot
Copy link
Collaborator

adk-bot commented Feb 24, 2026

Response from ADK Triaging Agent

Hello @neilruaro-camb, thank you for your contribution!

Before we can review this PR, please address the following items from our contribution guidelines:

  • Sign our Contributor License Agreement (CLA): Contributions to this project must be accompanied by a CLA. You can sign it at https://cla.developers.google.com/.
  • Associate an Issue: All PRs, other than small documentation or typo fixes, should have an Issue associated. Since this is a new feature, please create an issue that describes the feature and link it to this PR.

Once these items are addressed, we will be able to proceed with the review. Thanks!

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive integration for CAMB AI, providing a suite of 8 audio and speech tools. The implementation is well-structured, following existing conventions for toolsets in the ADK, including lazy loading of dependencies and clear separation of concerns into helper, tool factory, and toolset modules. The addition of a thorough unit test suite is also a great contribution. My review focuses on improving the documentation for tools that create temporary files to ensure users are aware of their responsibility for cleanup, preventing potential resource leaks in long-running applications.

"""Convert text to speech using camb.ai.

Supports 140+ languages and multiple voice models. The audio is
saved to a temporary file and the file path is returned.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The docstring should explicitly state that the caller is responsible for deleting the temporary file created by this tool. The current description is ambiguous and could lead to resource leaks if users are unaware of this responsibility. A more explicit statement will improve the tool's usability and prevent potential issues in long-running applications.

Suggested change
saved to a temporary file and the file path is returned.
saved to a temporary file and the file path is returned. The caller is responsible for deleting this file after use.

) -> str:
"""Translate text and convert to speech in one step using camb.ai.

Returns the file path to the generated audio file.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To prevent potential resource leaks, the docstring should clarify that the user of this tool is responsible for cleaning up the temporary audio file that is created. This is especially important for long-running services.

Suggested change
Returns the file path to the generated audio file.
Returns the file path to the generated audio file. The caller is responsible for deleting this file after use.

"""Generate sounds, music, or soundscapes from text descriptions using camb.ai.

Describe the sound or music you want and the tool will generate it.
Returns the file path to the generated audio file.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The docstring should be updated to make it clear that the caller must delete the temporary audio file created by this function. This will help prevent resource leaks in applications using the toolset.

Suggested change
Returns the file path to the generated audio file.
Returns the file path to the generated audio file. The caller is responsible for deleting this file after use.

Comment on lines +383 to +384
Provide either an audio URL or a local file path. Returns JSON with
paths to the separated vocals and background audio files.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This function may create temporary files if the API returns raw audio bytes. The docstring should be updated to explicitly state that the caller is responsible for deleting these files to avoid resource leaks.

Suggested change
Provide either an audio URL or a local file path. Returns JSON with
paths to the separated vocals and background audio files.
Provide either an audio URL or a local file path. Returns JSON with
paths to separated audio files. The caller is responsible for deleting
any temporary files created by this tool.

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

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants