API Reference - Textual TUI#
src
#
intentional_textual_ui
#
Init file for the intentional_textual_ui package.
__about__
#
Package descriptors for intentional-textual-ui.
audio_stream_ui
#
Textual UI for audio stream bots.
AudioStreamInterface
#
Bases: App
The main interface class for the audio stream bot UI.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
compose()
#
Layout of the UI.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
handle_audio_messages(event)
async
#
Plays audio responses from the bot and updates the bot status line.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
Dict[str, Any]
|
The event dictionary containing the audio message. |
required |
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
117 118 119 120 121 122 123 124 125 126 |
|
handle_conversation_end(_)
async
#
At the end of the conversation, closes the UI.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
128 129 130 131 132 133 134 |
|
handle_finish_user_response(_)
async
#
Updates the user status when they stop speaking.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
111 112 113 114 115 |
|
handle_start_user_response(_)
async
#
Updates the user status when they start speaking.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
105 106 107 108 109 |
|
handle_system_prompt_updated(event)
async
#
Prints to the console any text message from the bot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
Dict[str, Any]
|
The event dictionary containing the message. |
required |
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
96 97 98 99 100 101 102 103 |
|
handle_transcript(event)
async
#
Prints the transcripts in the chat history.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
83 84 85 86 87 88 89 90 91 92 93 94 |
|
on_mount()
#
Operations to be performed at mount time.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
77 78 79 80 81 |
|
ChatHistory
#
Bases: Markdown
A markdown widget that displays the chat history.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
20 21 22 23 |
|
SystemPrompt
#
Bases: Markdown
A markdown widget that displays the system prompt.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
32 33 34 35 |
|
UserStatus
#
Bases: Markdown
A markdown widget that displays the user status (speaking/silent).
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/audio_stream_ui.py
26 27 28 29 |
|
bot_interface
#
Local bot interface for Intentional.
TextualUIBotInterface
#
Bases: BotInterface
Bot that uses a Textual UI command line interface to interact with the user.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/bot_interface.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
run()
async
#
Chooses the specific loop to use for this combination of bot and modality and kicks it off.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/bot_interface.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
text_chat_ui
#
Textual UI for text-based bots.
ChatHistory
#
Bases: Markdown
A markdown widget that displays the chat history.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
16 17 18 19 |
|
MessageBox
#
Bases: Input
An input widget that allows the user to type a message.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
22 23 24 25 26 27 |
|
SystemPrompt
#
Bases: Markdown
A markdown widget that displays the system prompt.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
30 31 32 33 |
|
TextChatInterface
#
Bases: App
The main interface class for the text-based bot UI.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
compose()
#
Layout for the text-based bot UI.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
handle_finish_text_response(_)
async
#
Prints to the console when the bot stops generating a text response.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
101 102 103 104 105 |
|
handle_start_text_response(_)
async
#
Prints to the console when the bot starts generating a text response.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
92 93 94 95 96 97 98 99 |
|
handle_system_prompt_updated(event)
async
#
Prints to the console any text message from the bot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
Dict[str, Any]
|
The event dictionary containing the message. |
required |
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
118 119 120 121 122 123 124 125 |
|
handle_text_messages(event)
async
#
Prints to the console any text message from the bot. It is usually a chunk as the output is being streamed out.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
Dict[str, Any]
|
The event dictionary containing the message chunk. |
required |
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
107 108 109 110 111 112 113 114 115 116 |
|
on_mount()
#
Operations to perform when the UI is mounted.
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
72 73 74 75 76 77 |
|
send_message(event)
async
#
Sends a message to the bot when the user presses enter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
Changed
|
The event containing the message to send. |
required |
Source code in plugins/intentional-textual-ui/src/intentional_textual_ui/text_chat_ui.py
79 80 81 82 83 84 85 86 87 88 89 90 |
|