nat.plugins.langchain.agent.tool_calling_agent.register#
Attributes#
Classes#
Configuration for retrying LLM calls that are truncated (finish_reason='length'). |
|
A Tool Calling Agent requires an LLM which supports tool calling. A tool Calling Agent utilizes the tool |
Functions#
|
Module Contents#
- logger#
- class TruncationRetryConfig(/, **data: Any)#
Bases:
pydantic.BaseModelConfiguration for retrying LLM calls that are truncated (finish_reason=’length’).
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.- _check_scaling_strategy() TruncationRetryConfig#
- build_scaling_fn() collections.abc.Callable[[int], int]#
Build a callable that computes the next max_tokens from the current value.
- class ToolCallAgentWorkflowConfig#
Bases:
nat.data_models.agent.AgentBaseConfigA Tool Calling Agent requires an LLM which supports tool calling. A tool Calling Agent utilizes the tool input parameters to select the optimal tool. Supports handling tool errors.
- tool_names: list[nat.data_models.component_ref.FunctionRef | nat.data_models.component_ref.FunctionGroupRef] = None#
- truncation_retry: TruncationRetryConfig = None#
- return_direct: list[nat.data_models.component_ref.FunctionRef] | None = None#
- async tool_calling_agent_workflow(
- config: ToolCallAgentWorkflowConfig,
- builder: nat.builder.builder.Builder,