yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::cli::agent::SimpleChatSession Class Reference

Simple text-based chat session for AI agent interaction. More...

#include <simple_chat_session.h>

Collaboration diagram for yaze::cli::agent::SimpleChatSession:

Public Member Functions

 SimpleChatSession ()
 
void SetRomContext (Rom *rom)
 
void SetConfig (const AgentConfig &config)
 
absl::Status SendAndWaitForResponse (const std::string &message, std::string *response_out=nullptr)
 
absl::Status RunInteractive ()
 
absl::Status RunBatch (const std::string &input_file)
 
const std::vector< ChatMessage > & GetHistory () const
 
void Reset ()
 

Private Member Functions

void PrintMessage (const ChatMessage &msg, bool show_timestamp=false)
 
void PrintTable (const ChatMessage::TableData &table)
 
std::string ReadLineWithVim ()
 
std::vector< std::string > GetAutocompleteOptions (const std::string &partial)
 

Private Attributes

ConversationalAgentService agent_service_
 
AgentConfig config_
 
std::unique_ptr< VimModevim_mode_
 

Detailed Description

Simple text-based chat session for AI agent interaction.

Provides a basic REPL-style interface without FTXUI dependencies, suitable for automated testing and AI agent interactions.

Supports multiple input modes:

  • Interactive REPL (default when stdin is a TTY)
  • Piped input (reads lines from stdin)
  • Batch file (reads lines from file)
  • Single message (programmatic use)

Definition at line 32 of file simple_chat_session.h.

Constructor & Destructor Documentation

◆ SimpleChatSession()

yaze::cli::agent::SimpleChatSession::SimpleChatSession ( )
default

Member Function Documentation

◆ SetRomContext()

void yaze::cli::agent::SimpleChatSession::SetRomContext ( Rom rom)

◆ SetConfig()

void yaze::cli::agent::SimpleChatSession::SetConfig ( const AgentConfig config)
inline

◆ SendAndWaitForResponse()

absl::Status yaze::cli::agent::SimpleChatSession::SendAndWaitForResponse ( const std::string &  message,
std::string *  response_out = nullptr 
)

◆ RunInteractive()

◆ RunBatch()

◆ GetHistory()

const std::vector< ChatMessage > & yaze::cli::agent::SimpleChatSession::GetHistory ( ) const
inline

Definition at line 57 of file simple_chat_session.h.

References agent_service_, and yaze::cli::agent::ConversationalAgentService::GetHistory().

Here is the call graph for this function:

◆ Reset()

void yaze::cli::agent::SimpleChatSession::Reset ( )
inline

Definition at line 62 of file simple_chat_session.h.

References agent_service_, and yaze::cli::agent::ConversationalAgentService::ResetConversation().

Referenced by RunInteractive().

Here is the call graph for this function:

◆ PrintMessage()

◆ PrintTable()

void yaze::cli::agent::SimpleChatSession::PrintTable ( const ChatMessage::TableData table)
private

◆ ReadLineWithVim()

std::string yaze::cli::agent::SimpleChatSession::ReadLineWithVim ( )
private

Definition at line 525 of file simple_chat_session.cc.

References GetAutocompleteOptions(), and vim_mode_.

Referenced by RunInteractive().

Here is the call graph for this function:

◆ GetAutocompleteOptions()

std::vector< std::string > yaze::cli::agent::SimpleChatSession::GetAutocompleteOptions ( const std::string &  partial)
private

Definition at line 564 of file simple_chat_session.cc.

Referenced by ReadLineWithVim().

Member Data Documentation

◆ agent_service_

ConversationalAgentService yaze::cli::agent::SimpleChatSession::agent_service_
private

◆ config_

AgentConfig yaze::cli::agent::SimpleChatSession::config_
private

Definition at line 73 of file simple_chat_session.h.

Referenced by PrintMessage(), RunBatch(), RunInteractive(), and SetConfig().

◆ vim_mode_

std::unique_ptr<VimMode> yaze::cli::agent::SimpleChatSession::vim_mode_
private

Definition at line 74 of file simple_chat_session.h.

Referenced by ReadLineWithVim().


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