yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::gui::AgentChatWidget Class Reference

ImGui widget for conversational AI agent interaction. More...

#include <agent_chat_widget.h>

Collaboration diagram for yaze::gui::AgentChatWidget:

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::ConversationalAgentServiceGetService ()
 

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::ConversationalAgentServiceagent_service_
 
Romrom_
 
struct yaze::gui::AgentChatWidget::Colors colors_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AgentChatWidget()

◆ ~AgentChatWidget()

yaze::gui::AgentChatWidget::~AgentChatWidget ( )
default

Member Function Documentation

◆ Initialize()

void yaze::gui::AgentChatWidget::Initialize ( Rom rom)

Definition at line 44 of file agent_chat_widget.cc.

References agent_service_, and rom_.

◆ Render()

void yaze::gui::AgentChatWidget::Render ( bool *  p_open = nullptr)

◆ LoadHistory()

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().

◆ SaveHistory()

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().

◆ ClearHistory()

void yaze::gui::AgentChatWidget::ClearHistory ( )

Definition at line 254 of file agent_chat_widget.cc.

References agent_service_.

Referenced by RenderToolbar().

◆ GetService()

cli::agent::ConversationalAgentService * yaze::gui::AgentChatWidget::GetService ( )
inline

Definition at line 42 of file agent_chat_widget.h.

References agent_service_.

◆ RenderChatHistory()

void yaze::gui::AgentChatWidget::RenderChatHistory ( )
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().

Here is the call graph for this function:

◆ RenderInputArea()

void yaze::gui::AgentChatWidget::RenderInputArea ( )
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().

Here is the call graph for this function:

◆ RenderToolbar()

void yaze::gui::AgentChatWidget::RenderToolbar ( )
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().

Here is the call graph for this function:

◆ RenderMessageBubble()

◆ RenderTableData()

void yaze::gui::AgentChatWidget::RenderTableData ( const cli::agent::ChatMessage::TableData table)
private

◆ SendMessage()

void yaze::gui::AgentChatWidget::SendMessage ( const std::string &  message)
private

Definition at line 239 of file agent_chat_widget.cc.

References agent_service_, and scroll_to_bottom_.

Referenced by RenderInputArea().

◆ ScrollToBottom()

void yaze::gui::AgentChatWidget::ScrollToBottom ( )
private

Definition at line 332 of file agent_chat_widget.cc.

References scroll_to_bottom_.

Member Data Documentation

◆ input_buffer_

char yaze::gui::AgentChatWidget::input_buffer_[4096]
private

Definition at line 57 of file agent_chat_widget.h.

Referenced by AgentChatWidget(), and RenderInputArea().

◆ scroll_to_bottom_

bool yaze::gui::AgentChatWidget::scroll_to_bottom_
private

Definition at line 58 of file agent_chat_widget.h.

Referenced by Render(), ScrollToBottom(), and SendMessage().

◆ auto_scroll_

bool yaze::gui::AgentChatWidget::auto_scroll_
private

Definition at line 59 of file agent_chat_widget.h.

Referenced by Render(), and RenderToolbar().

◆ show_timestamps_

bool yaze::gui::AgentChatWidget::show_timestamps_
private

Definition at line 60 of file agent_chat_widget.h.

Referenced by RenderMessageBubble(), and RenderToolbar().

◆ show_reasoning_

bool yaze::gui::AgentChatWidget::show_reasoning_
private

Definition at line 61 of file agent_chat_widget.h.

Referenced by RenderToolbar().

◆ message_spacing_

float yaze::gui::AgentChatWidget::message_spacing_
private

Definition at line 62 of file agent_chat_widget.h.

Referenced by RenderChatHistory().

◆ agent_service_

std::unique_ptr<cli::agent::ConversationalAgentService> yaze::gui::AgentChatWidget::agent_service_
private

◆ rom_

Rom* yaze::gui::AgentChatWidget::rom_
private

Definition at line 66 of file agent_chat_widget.h.

Referenced by Initialize().

◆ colors_

struct yaze::gui::AgentChatWidget::Colors yaze::gui::AgentChatWidget::colors_
private

The documentation for this class was generated from the following files: