nat.test.llm#

Classes#

MockLLMConfig

Mock LLM configuration.

_ResponseChooser

Helper class to choose the next response according to config using itertools.cycle and provide synchronous and

Functions#

test_llm_provider(...)

Register the nat_test_llm provider for the NAT registry.

test_llm_langchain(config, builder)

LLM client for LangChain/LangGraph.

test_llm_llama_index(config, builder)

test_llm_crewai(config, builder)

LLM client for CrewAI.

test_llm_semantic_kernel(config, builder)

LLM client for SemanticKernel.

test_llm_agno(config, builder)

LLM client for agno.

test_llm_adk(config, builder)

LLM client for Google ADK.

Module Contents#

class MockLLMConfig#

Bases: nat.data_models.llm.LLMBaseConfig

Mock LLM configuration.

response_seq: list[str] = None#
delay_ms: int = None#
class _ResponseChooser(response_seq: list[str], delay_ms: int)#

Helper class to choose the next response according to config using itertools.cycle and provide synchronous and asynchronous sleep functions.

_cycler#
_delay_ms#
next_response() str#

Return the next response in the cycle, or an empty string if no responses are configured.

sync_sleep() None#
async async_sleep() None#
async test_llm_provider(
config: MockLLMConfig,
builder: nat.builder.builder.Builder,
) collections.abc.AsyncGenerator[nat.builder.llm.LLMProviderInfo, None]#

Register the nat_test_llm provider for the NAT registry.

async test_llm_langchain(
config: MockLLMConfig,
builder: nat.builder.builder.Builder,
)#

LLM client for LangChain/LangGraph.

async test_llm_llama_index(
config: MockLLMConfig,
builder: nat.builder.builder.Builder,
)#
async test_llm_crewai(
config: MockLLMConfig,
builder: nat.builder.builder.Builder,
)#

LLM client for CrewAI.

async test_llm_semantic_kernel(
config: MockLLMConfig,
builder: nat.builder.builder.Builder,
)#

LLM client for SemanticKernel.

async test_llm_agno(
config: MockLLMConfig,
builder: nat.builder.builder.Builder,
)#

LLM client for agno.

async test_llm_adk(
config: MockLLMConfig,
builder: nat.builder.builder.Builder,
)#

LLM client for Google ADK.