nat.plugins.adk.llm#

Attributes#

Functions#

azure_openai_adk(config, _builder)

Create and yield a Google ADK AzureOpenAI client from a NAT AzureOpenAIModelConfig.

litellm_adk(litellm_config, _builder)

nim_adk(config, _builder)

Create and yield a Google ADK NIM client from a NAT NIMModelConfig.

openai_adk(config, _builder)

Create and yield a Google ADK OpenAI client from a NAT OpenAIModelConfig.

dynamo_adk(config, _builder)

Create and yield a Google ADK LiteLlm client for Dynamo with prefix header support.

Module Contents#

logger#
async azure_openai_adk(
config: nat.llm.azure_openai_llm.AzureOpenAIModelConfig,
_builder: nat.builder.builder.Builder,
)#

Create and yield a Google ADK AzureOpenAI client from a NAT AzureOpenAIModelConfig.

Args:

config (AzureOpenAIModelConfig): The configuration for the AzureOpenAI model. _builder (Builder): The NAT builder instance.

async litellm_adk(
litellm_config: nat.llm.litellm_llm.LiteLlmModelConfig,
_builder: nat.builder.builder.Builder,
)#
async nim_adk(
config: nat.llm.nim_llm.NIMModelConfig,
_builder: nat.builder.builder.Builder,
)#

Create and yield a Google ADK NIM client from a NAT NIMModelConfig.

Args:

config (NIMModelConfig): The configuration for the NIM model. _builder (Builder): The NAT builder instance.

async openai_adk(
config: nat.llm.openai_llm.OpenAIModelConfig,
_builder: nat.builder.builder.Builder,
)#

Create and yield a Google ADK OpenAI client from a NAT OpenAIModelConfig.

Args:

config (OpenAIModelConfig): The configuration for the OpenAI model. _builder (Builder): The NAT builder instance.

async dynamo_adk(
config: nat.llm.dynamo_llm.DynamoModelConfig,
_builder: nat.builder.builder.Builder,
)#

Create and yield a Google ADK LiteLlm client for Dynamo with prefix header support.

This client configures Dynamo routing hints via LiteLLM’s extra_headers parameter. Unlike the LangChain implementation which injects headers per-request via httpx hooks, LiteLLM sets headers at initialization time.

For dynamic prefix IDs (e.g., per-evaluation-question), use the DynamoPrefixContext class:

from nat.llm.dynamo_llm import DynamoPrefixContext

DynamoPrefixContext.set("my-prefix-id")
# ... run LLM calls ...
DynamoPrefixContext.clear()

# Or use the context manager:
with DynamoPrefixContext.scope("my-prefix-id"):
    # ... run LLM calls ...

Note: The context variable approach requires custom integration as LiteLLM’s headers are static. For full dynamic prefix ID support, consider using the LangChain client.

Args:

config (DynamoModelConfig): The configuration for the Dynamo model. _builder (Builder): The NAT builder instance.