trading_agent.tools.read_file_tool
¶
The read_file tool: shows a text file with line numbers.
Typical usage example:
tool = ReadFileTool(policy)
ReadFileArguments
¶
Bases: BaseModel
The arguments of read_file.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
The file; a relative path starts at your desk folder. |
start_line |
int
|
The first line to show, counting from 1. |
maximum_lines |
int
|
How many lines to show at most. |
ReadFileTool
¶
Bases: Tool
Reads part of a text file.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
PathPolicy
|
The desk's read and write rules. |
required |
Source code in src/trading_agent/tools/read_file_tool.py
run
async
¶
Reads the requested lines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
ReadFileArguments
|
The file and which lines. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
The numbered lines, with a note when more follow, or an error. |