test_model
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| FixedArgsTestModel llmling_models.models.test_model TestModel subclass that supports fixed tool arguments. |
🛈 DocStrings¶
Test model with fixed tool arguments support.
FixedArgsTestModel
dataclass
¶
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. |