Simple text-based chat session for AI agent interaction. More...
#include <simple_chat_session.h>
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< VimMode > | vim_mode_ |
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:
Definition at line 32 of file simple_chat_session.h.
|
default |
void yaze::cli::agent::SimpleChatSession::SetRomContext | ( | Rom * | rom | ) |
Definition at line 29 of file simple_chat_session.cc.
References agent_service_, and yaze::cli::agent::ConversationalAgentService::SetRomContext().
Referenced by yaze::cli::handlers::SimpleChatCommandHandler::Execute(), and yaze::cli::agent::HandleSimpleChatCommand().
|
inline |
Definition at line 40 of file simple_chat_session.h.
References agent_service_, config_, and yaze::cli::agent::ConversationalAgentService::SetConfig().
Referenced by yaze::cli::handlers::SimpleChatCommandHandler::Execute(), and yaze::cli::agent::HandleSimpleChatCommand().
absl::Status yaze::cli::agent::SimpleChatSession::SendAndWaitForResponse | ( | const std::string & | message, |
std::string * | response_out = nullptr |
||
) |
Definition at line 307 of file simple_chat_session.cc.
References agent_service_, and yaze::cli::agent::ConversationalAgentService::SendMessage().
Referenced by yaze::cli::handlers::SimpleChatCommandHandler::Execute(), and yaze::cli::agent::HandleSimpleChatCommand().
absl::Status yaze::cli::agent::SimpleChatSession::RunInteractive | ( | ) |
Definition at line 323 of file simple_chat_session.cc.
References agent_service_, config_, yaze::cli::agent::AgentConfig::enable_vim_mode, yaze::cli::agent::ConversationalAgentService::GetMetrics(), yaze::cli::agent::kCompact, yaze::cli::agent::kFriendly, yaze::cli::agent::kJson, yaze::cli::agent::kMarkdown, yaze::cli::agent::AgentConfig::output_format, PrintMessage(), ReadLineWithVim(), Reset(), yaze::cli::agent::ConversationalAgentService::SendMessage(), and yaze::cli::agent::ChatMessage::SessionMetrics::turn_index.
Referenced by yaze::cli::handlers::SimpleChatCommandHandler::Execute(), and yaze::cli::agent::HandleSimpleChatCommand().
absl::Status yaze::cli::agent::SimpleChatSession::RunBatch | ( | const std::string & | input_file | ) |
Definition at line 435 of file simple_chat_session.cc.
References agent_service_, config_, yaze::cli::agent::ConversationalAgentService::GetMetrics(), yaze::cli::agent::kCompact, yaze::cli::agent::kFriendly, yaze::cli::agent::kJson, yaze::cli::agent::kMarkdown, yaze::cli::agent::AgentConfig::output_format, PrintMessage(), yaze::cli::agent::ConversationalAgentService::SendMessage(), and yaze::cli::agent::ChatMessage::SessionMetrics::turn_index.
Referenced by yaze::cli::handlers::SimpleChatCommandHandler::Execute().
|
inline |
Definition at line 57 of file simple_chat_session.h.
References agent_service_, and yaze::cli::agent::ConversationalAgentService::GetHistory().
|
inline |
Definition at line 62 of file simple_chat_session.h.
References agent_service_, and yaze::cli::agent::ConversationalAgentService::ResetConversation().
Referenced by RunInteractive().
|
private |
Definition at line 233 of file simple_chat_session.cc.
References config_, yaze::cli::agent::ChatMessage::json_pretty, yaze::cli::agent::kCompact, yaze::cli::agent::kFriendly, yaze::cli::agent::kJson, yaze::cli::agent::kMarkdown, yaze::cli::agent::ChatMessage::kUser, yaze::cli::agent::ChatMessage::message, yaze::cli::agent::ChatMessage::metrics, yaze::cli::agent::AgentConfig::output_format, PrintTable(), yaze::cli::agent::ChatMessage::sender, yaze::cli::agent::ChatMessage::table_data, and yaze::cli::agent::ChatMessage::timestamp.
Referenced by RunBatch(), and RunInteractive().
|
private |
Definition at line 197 of file simple_chat_session.cc.
References yaze::cli::agent::ChatMessage::TableData::headers, and yaze::cli::agent::ChatMessage::TableData::rows.
Referenced by PrintMessage().
|
private |
Definition at line 525 of file simple_chat_session.cc.
References GetAutocompleteOptions(), and vim_mode_.
Referenced by RunInteractive().
|
private |
Definition at line 564 of file simple_chat_session.cc.
Referenced by ReadLineWithVim().
|
private |
Definition at line 72 of file simple_chat_session.h.
Referenced by GetHistory(), Reset(), RunBatch(), RunInteractive(), SendAndWaitForResponse(), SetConfig(), and SetRomContext().
|
private |
Definition at line 73 of file simple_chat_session.h.
Referenced by PrintMessage(), RunBatch(), RunInteractive(), and SetConfig().
|
private |
Definition at line 74 of file simple_chat_session.h.
Referenced by ReadLineWithVim().