trading_agent.tools.view_image_tool
¶
The view_image tool: shows the model a picture file, such as a chart it made or one the user sent earlier.
Typical usage example:
tool = ViewImageTool(policy)
ViewImageArguments
¶
Bases: BaseModel
The arguments of view_image.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
The picture; a relative path starts at your desk folder. |
ViewImageTool
¶
Bases: Tool
Shows the model a PNG, JPEG, WebP or GIF file.
Creates the tool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
policy
|
PathPolicy
|
The desk's read rules. |
required |
image_preparer
|
ImagePreparer | None
|
Checks and resizes pictures; None for a new one. |
None
|
Source code in src/trading_agent/tools/view_image_tool.py
run
async
¶
Loads the picture.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
ViewImageArguments
|
The picture's path. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
A line naming the picture, with the picture attached, or an error. |