ImGui widget for conversational AI agent interaction. More...
#include <agent_chat_widget.h>
Classes | |
struct | Colors |
Public Member Functions | |
AgentChatWidget () | |
~AgentChatWidget () | |
void | Initialize (Rom *rom) |
void | Render (bool *p_open=nullptr) |
absl::Status | LoadHistory (const std::string &filepath) |
absl::Status | SaveHistory (const std::string &filepath) |
void | ClearHistory () |
cli::agent::ConversationalAgentService * | GetService () |
Private Member Functions | |
void | RenderChatHistory () |
void | RenderInputArea () |
void | RenderToolbar () |
void | RenderMessageBubble (const cli::agent::ChatMessage &msg, int index) |
void | RenderTableData (const cli::agent::ChatMessage::TableData &table) |
void | SendMessage (const std::string &message) |
void | ScrollToBottom () |
Private Attributes | |
char | input_buffer_ [4096] |
bool | scroll_to_bottom_ |
bool | auto_scroll_ |
bool | show_timestamps_ |
bool | show_reasoning_ |
float | message_spacing_ |
std::unique_ptr< cli::agent::ConversationalAgentService > | agent_service_ |
Rom * | rom_ |
struct yaze::gui::AgentChatWidget::Colors | colors_ |
ImGui widget for conversational AI agent interaction.
Provides a chat-like interface in the YAZE GUI for interacting with the z3ed AI agent. Shares the same backend as the TUI chat interface.
Definition at line 23 of file agent_chat_widget.h.
yaze::gui::AgentChatWidget::AgentChatWidget | ( | ) |
Definition at line 20 of file agent_chat_widget.cc.
References yaze::gui::AgentChatWidget::Colors::agent_bubble, agent_service_, colors_, yaze::gui::AgentChatWidget::Colors::error_text, input_buffer_, yaze::gui::AgentChatWidget::Colors::system_text, yaze::gui::AgentChatWidget::Colors::timestamp_text, yaze::gui::AgentChatWidget::Colors::tool_call_bg, and yaze::gui::AgentChatWidget::Colors::user_bubble.
|
default |
void yaze::gui::AgentChatWidget::Initialize | ( | Rom * | rom | ) |
Definition at line 44 of file agent_chat_widget.cc.
References agent_service_, and rom_.
void yaze::gui::AgentChatWidget::Render | ( | bool * | p_open = nullptr | ) |
Definition at line 53 of file agent_chat_widget.cc.
References auto_scroll_, colors_, yaze::gui::AgentChatWidget::Colors::error_text, RenderChatHistory(), RenderInputArea(), RenderToolbar(), and scroll_to_bottom_.
absl::Status yaze::gui::AgentChatWidget::LoadHistory | ( | const std::string & | filepath | ) |
Definition at line 262 of file agent_chat_widget.cc.
References agent_service_.
Referenced by RenderToolbar().
absl::Status yaze::gui::AgentChatWidget::SaveHistory | ( | const std::string & | filepath | ) |
Definition at line 292 of file agent_chat_widget.cc.
References agent_service_, and yaze::cli::agent::ChatMessage::kUser.
Referenced by RenderToolbar().
void yaze::gui::AgentChatWidget::ClearHistory | ( | ) |
Definition at line 254 of file agent_chat_widget.cc.
References agent_service_.
Referenced by RenderToolbar().
|
inline |
Definition at line 42 of file agent_chat_widget.h.
References agent_service_.
|
private |
Definition at line 129 of file agent_chat_widget.cc.
References agent_service_, colors_, message_spacing_, RenderMessageBubble(), and yaze::gui::AgentChatWidget::Colors::system_text.
Referenced by Render().
|
private |
Definition at line 211 of file agent_chat_widget.cc.
References colors_, input_buffer_, SendMessage(), and yaze::gui::AgentChatWidget::Colors::system_text.
Referenced by Render().
|
private |
Definition at line 96 of file agent_chat_widget.cc.
References auto_scroll_, ClearHistory(), LoadHistory(), SaveHistory(), show_reasoning_, and show_timestamps_.
Referenced by Render().
|
private |
Definition at line 151 of file agent_chat_widget.cc.
References yaze::gui::AgentChatWidget::Colors::agent_bubble, colors_, yaze::cli::agent::ChatMessage::json_pretty, yaze::cli::agent::ChatMessage::kUser, yaze::cli::agent::ChatMessage::message, RenderTableData(), yaze::cli::agent::ChatMessage::sender, show_timestamps_, yaze::cli::agent::ChatMessage::table_data, yaze::cli::agent::ChatMessage::timestamp, yaze::gui::AgentChatWidget::Colors::timestamp_text, and yaze::gui::AgentChatWidget::Colors::user_bubble.
Referenced by RenderChatHistory().
|
private |
Definition at line 182 of file agent_chat_widget.cc.
References yaze::cli::agent::ChatMessage::TableData::headers, and yaze::cli::agent::ChatMessage::TableData::rows.
Referenced by RenderMessageBubble().
|
private |
Definition at line 239 of file agent_chat_widget.cc.
References agent_service_, and scroll_to_bottom_.
Referenced by RenderInputArea().
|
private |
Definition at line 332 of file agent_chat_widget.cc.
References scroll_to_bottom_.
|
private |
Definition at line 57 of file agent_chat_widget.h.
Referenced by AgentChatWidget(), and RenderInputArea().
|
private |
Definition at line 58 of file agent_chat_widget.h.
Referenced by Render(), ScrollToBottom(), and SendMessage().
|
private |
Definition at line 59 of file agent_chat_widget.h.
Referenced by Render(), and RenderToolbar().
|
private |
Definition at line 60 of file agent_chat_widget.h.
Referenced by RenderMessageBubble(), and RenderToolbar().
|
private |
Definition at line 61 of file agent_chat_widget.h.
Referenced by RenderToolbar().
|
private |
Definition at line 62 of file agent_chat_widget.h.
Referenced by RenderChatHistory().
|
private |
Definition at line 65 of file agent_chat_widget.h.
Referenced by AgentChatWidget(), ClearHistory(), GetService(), Initialize(), LoadHistory(), RenderChatHistory(), SaveHistory(), and SendMessage().
|
private |
Definition at line 66 of file agent_chat_widget.h.
Referenced by Initialize().
|
private |
Referenced by AgentChatWidget(), Render(), RenderChatHistory(), RenderInputArea(), and RenderMessageBubble().