trading_agent.terminal.widgets.desk_message_view
¶
A message the desk sent with send_message or send_image: its text, its pictures and its documents.
Pictures are drawn in the chat; documents are listed, and Enter on one opens it with the desktop's default program.
Typical usage example:
view = DeskMessageView('general', event)
DocumentLine
¶
Bases: Static
One document in a desk message; Enter or a click opens it.
Creates the line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
desk_name
|
str
|
The desk that sent it. |
required |
attachment
|
dict[str, Any]
|
The document. |
required |
Source code in src/trading_agent/terminal/widgets/desk_message_view.py
on_click
¶
DeskMessageView
¶
Bases: Vertical
A message from the desk.
Creates the view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
desk_name
|
str
|
The desk that sent it. |
required |
event
|
dict[str, Any]
|
The message event. |
required |
with_time
|
bool
|
Whether to show the time, for a message outside a turn. |
False
|
Source code in src/trading_agent/terminal/widgets/desk_message_view.py
compose
¶
Builds the view.
Yields:
| Type | Description |
|---|---|
Widget
|
The heading, the text, the pictures and the documents. |