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

#include <conversational_agent_service.h>

Collaboration diagram for yaze::cli::agent::ConversationalAgentService:

Classes

struct  InternalMetrics
 

Public Member Functions

 ConversationalAgentService ()
 
 ConversationalAgentService (const AgentConfig &config)
 
absl::StatusOr< ChatMessageSendMessage (const std::string &message)
 
const std::vector< ChatMessage > & GetHistory () const
 
void SetRomContext (Rom *rom)
 
void ResetConversation ()
 
void SetConfig (const AgentConfig &config)
 
const AgentConfigGetConfig () const
 
ChatMessage::SessionMetrics GetMetrics () const
 
void ReplaceHistory (std::vector< ChatMessage > history)
 

Private Member Functions

void TrimHistoryIfNeeded ()
 
ChatMessage::SessionMetrics BuildMetricsSnapshot () const
 
void RebuildMetricsFromHistory ()
 

Private Attributes

std::vector< ChatMessagehistory_
 
std::unique_ptr< AIServiceai_service_
 
ToolDispatcher tool_dispatcher_
 
Romrom_context_ = nullptr
 
AgentConfig config_
 
InternalMetrics metrics_
 

Detailed Description

Definition at line 74 of file conversational_agent_service.h.

Constructor & Destructor Documentation

◆ ConversationalAgentService() [1/2]

yaze::cli::agent::ConversationalAgentService::ConversationalAgentService ( )

Definition at line 175 of file conversational_agent_service.cc.

References ai_service_, and yaze::cli::CreateAIService().

Here is the call graph for this function:

◆ ConversationalAgentService() [2/2]

yaze::cli::agent::ConversationalAgentService::ConversationalAgentService ( const AgentConfig config)
explicit

Definition at line 179 of file conversational_agent_service.cc.

References ai_service_, and yaze::cli::CreateAIService().

Here is the call graph for this function:

Member Function Documentation

◆ SendMessage()

absl::StatusOr< ChatMessage > yaze::cli::agent::ConversationalAgentService::SendMessage ( const std::string &  message)

Definition at line 229 of file conversational_agent_service.cc.

References yaze::cli::agent::ConversationalAgentService::InternalMetrics::agent_messages, yaze::cli::agent::ProposalCreationRequest::ai_provider, ai_service_, BuildMetricsSnapshot(), yaze::cli::agent::ChatMessage::ProposalSummary::change_count, yaze::cli::agent::ConversationalAgentService::InternalMetrics::commands_generated, config_, yaze::cli::agent::CreateProposalFromAgentResponse(), yaze::cli::agent::ToolDispatcher::Dispatch(), yaze::cli::agent::ChatMessage::ProposalSummary::executed_commands, history_, yaze::cli::agent::ChatMessage::ProposalSummary::id, yaze::Rom::is_loaded(), yaze::cli::agent::ChatMessage::kAgent, yaze::cli::util::colors::kCyan, yaze::cli::util::colors::kDim, yaze::cli::util::colors::kReset, yaze::cli::agent::ChatMessage::kUser, yaze::cli::util::colors::kYellow, yaze::cli::agent::AgentConfig::max_tool_iterations, yaze::cli::agent::ChatMessage::metrics, metrics_, yaze::cli::util::PrintError(), yaze::cli::util::PrintInfo(), yaze::cli::util::PrintSeparator(), yaze::cli::util::PrintSuccess(), yaze::cli::util::PrintToolCall(), yaze::cli::util::PrintWarning(), yaze::cli::agent::ProposalCreationRequest::prompt, yaze::cli::agent::ChatMessage::proposal, yaze::cli::agent::ChatMessage::ProposalSummary::proposal_json_path, yaze::cli::agent::ConversationalAgentService::InternalMetrics::proposals_created, yaze::cli::agent::ProposalCreationRequest::response, yaze::cli::agent::ProposalCreationRequest::rom, rom_context_, yaze::cli::agent::ProposalCreationRequest::sandbox_label, yaze::cli::agent::ChatMessage::ProposalSummary::sandbox_rom_path, yaze::cli::agent::AgentConfig::show_reasoning, yaze::cli::util::LoadingIndicator::Start(), yaze::cli::util::LoadingIndicator::Stop(), yaze::cli::agent::ConversationalAgentService::InternalMetrics::tool_calls, tool_dispatcher_, yaze::cli::agent::ConversationalAgentService::InternalMetrics::total_latency, TrimHistoryIfNeeded(), yaze::cli::agent::ConversationalAgentService::InternalMetrics::turns_completed, yaze::cli::agent::ConversationalAgentService::InternalMetrics::user_messages, and yaze::cli::agent::AgentConfig::verbose.

Referenced by yaze::cli::tui::ChatTUI::LaunchAgentPrompt(), yaze::cli::tui::ChatTUI::OnSubmit(), yaze::cli::EnhancedChatComponent::ProcessMessage(), yaze::editor::AgentChatWidget::RenderInputBox(), yaze::cli::agent::SimpleChatSession::RunBatch(), yaze::cli::agent::SimpleChatSession::RunInteractive(), yaze::cli::agent::anonymous_namespace{conversation_test.cc}::RunTestCase(), yaze::cli::agent::SimpleChatSession::SendAndWaitForResponse(), and yaze::editor::AgentChatWidget::SetChatHistoryPopup().

◆ GetHistory()

◆ SetRomContext()

◆ ResetConversation()

◆ SetConfig()

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

◆ GetConfig()

const AgentConfig & yaze::cli::agent::ConversationalAgentService::GetConfig ( ) const
inline

Definition at line 93 of file conversational_agent_service.h.

References config_.

◆ GetMetrics()

ChatMessage::SessionMetrics yaze::cli::agent::ConversationalAgentService::GetMetrics ( ) const

◆ ReplaceHistory()

void yaze::cli::agent::ConversationalAgentService::ReplaceHistory ( std::vector< ChatMessage history)

◆ TrimHistoryIfNeeded()

void yaze::cli::agent::ConversationalAgentService::TrimHistoryIfNeeded ( )
private

◆ BuildMetricsSnapshot()

◆ RebuildMetricsFromHistory()

Member Data Documentation

◆ history_

std::vector<ChatMessage> yaze::cli::agent::ConversationalAgentService::history_
private

◆ ai_service_

std::unique_ptr<AIService> yaze::cli::agent::ConversationalAgentService::ai_service_
private

◆ tool_dispatcher_

ToolDispatcher yaze::cli::agent::ConversationalAgentService::tool_dispatcher_
private

Definition at line 116 of file conversational_agent_service.h.

Referenced by SendMessage(), and SetRomContext().

◆ rom_context_

Rom* yaze::cli::agent::ConversationalAgentService::rom_context_ = nullptr
private

Definition at line 117 of file conversational_agent_service.h.

Referenced by SendMessage(), and SetRomContext().

◆ config_

AgentConfig yaze::cli::agent::ConversationalAgentService::config_
private

◆ metrics_

InternalMetrics yaze::cli::agent::ConversationalAgentService::metrics_
private

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