> This page is for NeMo Relay, version dev.
> For other versions, use one of these documentation indexes:
> - Latest (v0.10.4) (default): https://docs.nvidia.com/nemo/relay/latest/llms.txt
> - dev: https://docs.nvidia.com/nemo/relay/dev/llms.txt
> - v0.11.0: https://docs.nvidia.com/nemo/relay/v0.11.0/llms.txt
> - v0.10.4: https://docs.nvidia.com/nemo/relay/v0.10.4/llms.txt
> - v0.9.4: https://docs.nvidia.com/nemo/relay/v0.9.4/llms.txt
> - v0.8.4: https://docs.nvidia.com/nemo/relay/v0.8.4/llms.txt
> - v0.7.3: https://docs.nvidia.com/nemo/relay/v0.7.3/llms.txt

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

# nemo_relay.integrations.google_adk.plugin

> Provide the Google ADK plugin that records invocations and agent runs as scopes.

Generated from `python/nemo_relay/integrations/google_adk/plugin.py`.

Module `nemo_relay.integrations.google_adk.plugin`.

Provide the Google ADK plugin that records invocations and agent runs as scopes.

## Classes

### `NemoRelayPlugin(BasePlugin)`

Record ADK invocations and agent runs as scopes, and run the model and tool calls that ADK makes through Relay.

#### Methods

##### `NemoRelayPlugin`

```python
def NemoRelayPlugin(name: str = 'nemo_relay') -> None
```

Create an instance.

##### `before_run_callback`

```python
async def before_run_callback(*, invocation_context: InvocationContext) -> types.Content | None
```

##### `after_run_callback`

```python
async def after_run_callback(*, invocation_context: InvocationContext) -> None
```

End the invocation as ADK reports it, as cancelled for an aborted run and otherwise as completed.

##### `on_run_error_callback`

```python
async def on_run_error_callback(*, invocation_context: InvocationContext, error: Exception) -> None
```

##### `close`

```python
async def close() -> None
```

Close the scope of each invocation that is still running as cancelled.

##### `before_agent_callback`

```python
async def before_agent_callback(*, agent: BaseAgent, callback_context: CallbackContext) -> types.Content | None
```

##### `after_agent_callback`

```python
async def after_agent_callback(*, agent: BaseAgent, callback_context: CallbackContext) -> types.Content | None
```

Close the agent run, as cancelled when ADK calls this hook while the agent's task is being cancelled.

##### `on_agent_error_callback`

```python
async def on_agent_error_callback(*, agent: BaseAgent, callback_context: CallbackContext, error: Exception) -> None
```

##### `before_model_callback`

```python
async def before_model_callback(*, callback_context: CallbackContext, llm_request: LlmRequest) -> LlmResponse | None
```

##### `before_tool_callback`

```python
async def before_tool_callback(*, tool: BaseTool, tool_args: dict[str, Any], tool_context: ToolContext) -> dict[str, Any] | None
```

##### `on_event_callback`

```python
async def on_event_callback(*, invocation_context: InvocationContext, event: Event) -> Event | None
```

Record final responses and the provider-run tools that each event reports.