Events
Dasshh uses an event-queue messaging architecture to update the UI with events.
This page lays out all the event classes available.
Note
Events in Dasshh are based on Textual's Message system
UI Events
Events related to user interface interactions and navigation.
event
ChangeView
Change the view on the main screen
Attributes:
Attribute | Type | Description |
---|---|---|
view | str | The name of the view to switch to |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
view | The target view name (e.g., "chat", "settings", "about") |
Chat Events
Events related to chat interactions and session management.
event
NewMessage
Send a message to the chat
Attributes:
Attribute | Type | Description |
---|---|---|
message | str | The message content to send |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
message | The user message to send to the assistant |
event
NewSession
Create a new session
Constructor:
Notes: - This event triggers the creation of a new chat session - No parameters required
event
LoadSession
Load a previous session
Attributes:
Attribute | Type | Description |
---|---|---|
session_id | str | The ID of the session to load |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
session_id | The unique identifier of the session to load |
event
DeleteSession
Delete an existing session
Attributes:
Attribute | Type | Description |
---|---|---|
session_id | str | The ID of the session to delete |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
session_id | The unique identifier of the session to delete |
Assistant Runtime Events
Events related to AI assistant processing and responses.
event
AssistantResponseStart
Event triggered before assistant starts processing a query
Attributes:
Attribute | Type | Description |
---|---|---|
invocation_id | str | Unique identifier for this query invocation |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
invocation_id | Unique ID to track this specific query through its lifecycle |
event
AssistantResponseUpdate
Event triggered when assistant returns a partial response (streaming)
Attributes:
Attribute | Type | Description |
---|---|---|
invocation_id | str | Unique identifier for this query invocation |
content | str | Partial content of the response |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
invocation_id | Unique ID to track this specific query | |
content | The partial response content to append |
event
AssistantResponseComplete
Event triggered when assistant completes processing a query
Attributes:
Attribute | Type | Description |
---|---|---|
invocation_id | str | Unique identifier for this query invocation |
content | str | Final complete content of the response |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
invocation_id | Unique ID to track this specific query | |
content | The final complete response content |
event
AssistantResponseError
Event triggered when assistant encounters an error
Attributes:
Attribute | Type | Description |
---|---|---|
invocation_id | str | Unique identifier for this query invocation |
error | str | Error message describing what went wrong |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
invocation_id | Unique ID to track this specific query | |
error | Description of the error that occurred |
Tool Call Events
Events related to tool execution during assistant processing.
event
AssistantToolCallStart
Event triggered when assistant starts a tool call
Attributes:
Attribute | Type | Description |
---|---|---|
invocation_id | str | Unique identifier for the query invocation |
tool_call_id | str | Unique identifier for this specific tool call |
tool_name | str | Name of the tool being called |
args | str | JSON string of arguments passed to the tool |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
invocation_id | Unique ID to track the query | |
tool_call_id | Unique ID for this tool call within the query | |
tool_name | Name of the tool being executed | |
args | JSON-encoded arguments being passed to the tool |
event
AssistantToolCallComplete
Event triggered when assistant completes a tool call
Attributes:
Attribute | Type | Description |
---|---|---|
invocation_id | str | Unique identifier for the query invocation |
tool_call_id | str | Unique identifier for this specific tool call |
tool_name | str | Name of the tool that was called |
result | str | JSON string of the tool's return value |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
invocation_id | Unique ID to track the query | |
tool_call_id | Unique ID for this tool call within the query | |
tool_name | Name of the tool that was executed | |
result | JSON-encoded result returned by the tool |
event
AssistantToolCallError
Event triggered when assistant encounters an error during a tool call
Attributes:
Attribute | Type | Description |
---|---|---|
invocation_id | str | Unique identifier for the query invocation |
tool_call_id | str | Unique identifier for this specific tool call |
tool_name | str | Name of the tool that failed |
error | str | Error message describing what went wrong |
Constructor:
Parameters:
Param | Default |
Description |
---|---|---|
invocation_id | Unique ID to track the query | |
tool_call_id | Unique ID for this tool call within the query | |
tool_name | Name of the tool that encountered an error | |
error | Description of the error that occurred |
Event Flow
Understanding how events flow through the system:
Query Processing Flow
- User Input:
NewMessage
→ User types a message - Assistant Start:
AssistantResponseStart
→ Processing begins - Streaming Updates:
AssistantResponseUpdate
→ Partial responses (optional) - Tool Execution (if needed):
AssistantToolCallStart
→ Tool begins executionAssistantToolCallComplete
→ Tool finishes successfullyAssistantToolCallError
→ Tool encounters error (alternative)
- Assistant Complete:
AssistantResponseComplete
→ Final response - Error Handling:
AssistantResponseError
→ If processing fails (alternative)
Session Management Flow
- Create:
NewSession
→ Creates a new conversation - Load:
LoadSession
→ Switches to existing conversation - Delete:
DeleteSession
→ Removes conversation from history
UI Navigation Flow
- View Change:
ChangeView
→ Switches between app sections (chat, settings, about)