> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/labs-voice-agent/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/labs-voice-agent/_mcp/server.

# nemo_voice_agent.utils.tool_calling.mixins

## Module Contents

### Classes

| Name                                                                               | Description                     |
| ---------------------------------------------------------------------------------- | ------------------------------- |
| [`ToolCallingMixin`](#nemo_voice_agent-utils-tool_calling-mixins-ToolCallingMixin) | A mixin class for tool calling. |

### Functions

| Name                                                                                                       | Description                       |
| ---------------------------------------------------------------------------------------------------------- | --------------------------------- |
| [`register_direct_tools_to_llm`](#nemo_voice_agent-utils-tool_calling-mixins-register_direct_tools_to_llm) | Register direct tools to the LLM. |

### API

```python
class nemo_voice_agent.utils.tool_calling.mixins.ToolCallingMixin()
```

A mixin class for tool calling.
Subclasses must implement the `setup_tool_calling` method to register all available tools
using `self.register_direct_function()`. Then the `__init__` method of the subclass should
call the `setup_tool_calling` method to register the tools.

**`available_tools`**

Return a dictionary of available tools, where the key is the tool name and the value is the direct function.

---

```python
nemo_voice_agent.utils.tool_calling.mixins.ToolCallingMixin.register_direct_function(
    function_name: str,
    function: pipecat.adapters.schemas.direct_function.DirectFunction
)
```

Register a direct function to be called by the LLM.

**Parameters:**

**`function_name`**

The name of the function to register.

---

**`function`**

The direct function to register.

---

```python
nemo_voice_agent.utils.tool_calling.mixins.ToolCallingMixin.setup_tool_calling()
```

Setup the tool calling mixin by registering all available tools using self.register\_direct\_function().

```python
nemo_voice_agent.utils.tool_calling.mixins.register_direct_tools_to_llm(
    llm: pipecat.services.openai.llm.OpenAILLMService,
    context: pipecat.processors.aggregators.llm_context.LLMContext,
    tool_mixins: list[nemo_voice_agent.utils.tool_calling.mixins.ToolCallingMixin] = [],
    tools: list[pipecat.adapters.schemas.direct_function.DirectFunction] = [],
    cancel_on_interruption: bool = True
) -> None
```

Register direct tools to the LLM.
Args:
llm: The LLM service to use.
context: The LLM context to use.
tools: The list of tools (instances of either `DirectFunction` or `ToolCallingMixin`) to use.