Default Tools¶
Default tools included with every LLMAgent.
ReadFileTool
¶
Bases: BaseTool
A tool for reading the contents of a local file.
Source code in src/llm_agents_from_scratch/tools/default/read_file.py
__call__
¶
Execute the read-file tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_call
|
ToolCall
|
The ToolCall to execute. |
required |
*args
|
Any
|
Additional positional arguments. |
()
|
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
ToolCallResult |
ToolCallResult
|
The file contents, or an error result. |
Source code in src/llm_agents_from_scratch/tools/default/read_file.py
PythonInterpreterTool
¶
Bases: BaseTool
A tool for executing a local Python script.
Source code in src/llm_agents_from_scratch/tools/default/interpreter.py
__call__
¶
Execute the Python interpreter tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tool_call
|
ToolCall
|
The ToolCall to execute. |
required |
*args
|
Any
|
Additional positional arguments. |
()
|
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
ToolCallResult |
ToolCallResult
|
The script stdout, or an error result. |