FixedArgsTestModel
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| TestModel pydantic_ai.models.test A model specifically for testing purposes. |
â‹” Inheritance diagram¶
graph TD
3973672691["test_model.FixedArgsTestModel"]
328545894["test.TestModel"]
3233824472["_in_memory_batch.InMemoryBatchModel"]
956387754["models.Model"]
1457841118["_abstract.AbstractModel"]
925645236["abc.ABC"]
2751680898["builtins.object"]
3481597255["typing.Generic"]
328545894 --> 3973672691
3233824472 --> 328545894
956387754 --> 3233824472
1457841118 --> 956387754
925645236 --> 1457841118
2751680898 --> 925645236
3481597255 --> 956387754
2751680898 --> 3481597255
🛈 DocStrings¶
Bases: TestModel
TestModel subclass that supports fixed tool arguments.
This is useful for testing scenarios where you need deterministic, specific tool arguments instead of auto-generated ones.
Example
Source code in src/llmling_models/models/test_model.py
tool_args
class-attribute
instance-attribute
¶
Mapping of tool_name -> args to use instead of generated args.
__init__
¶
__init__(
*,
tool_args: dict[str, dict[str, Any]] | None = None,
call_tools: list[str] | Literal["all"] = "all",
custom_output_text: str | None = None,
custom_output_args: Any | None = None,
seed: int = 0,
) -> None
Initialize FixedArgsTestModel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_args
|
dict[str, dict[str, Any]] | None
|
Mapping of tool_name -> args to use for that tool. Tools not in this mapping will use auto-generated args. |
None
|
call_tools
|
list[str] | Literal['all']
|
List of tools to call, or 'all' to call all tools. |
'all'
|
custom_output_text
|
str | None
|
Custom text to return as final output. |
None
|
custom_output_args
|
Any | None
|
Custom args to pass to output tool. |
None
|
seed
|
int
|
Seed for generating random args (for tools not in tool_args). |
0
|
Source code in src/llmling_models/models/test_model.py
gen_tool_args
¶
Generate tool arguments, using fixed args if available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_def
|
ToolDefinition
|
The tool definition to generate args for. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
Fixed args if tool_name is in tool_args, otherwise auto-generated. |