trading_agent.tools.propose_file_change_tool
¶
A tool with which a desk proposes a change to one of the user's files.
The desk cannot edit the user's files. It sends the complete new text and a reason, and the user accepts or rejects it with trading-agent proposals.
Typical usage example:
tool = ProposeFileChangeTool(store, 'main')
ProposeFileChangeArguments
¶
Bases: BaseModel
The arguments of propose_file_change.
Attributes:
| Name | Type | Description |
|---|---|---|
file_name |
Literal['Agents.md', 'User.md', 'TradingRules.md', 'Persona.md']
|
Which of the user's files to change. |
content |
str
|
The complete new text of the file. |
reason |
str
|
Why the change is needed, in one or two sentences. |
ProposeFileChangeTool
¶
Bases: Tool
Saves a proposed new version of one of the user's files.
Creates the tool for one desk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store
|
ProposalStore
|
Where proposals are saved. |
required |
desk_name
|
str
|
The desk using the tool. |
required |
Source code in src/trading_agent/tools/propose_file_change_tool.py
run
async
¶
Saves the proposal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
arguments
|
ProposeFileChangeArguments
|
The file, its new text and the reason. |
required |
Returns:
| Type | Description |
|---|---|
ToolResult
|
The new proposal's id and how the user accepts it. |