Enhance chat command functionality with ROM context integration and improve TUI initialization
This commit is contained in:
@@ -14,7 +14,16 @@ namespace tui {
|
||||
|
||||
using namespace ftxui;
|
||||
|
||||
ChatTUI::ChatTUI() = default;
|
||||
ChatTUI::ChatTUI(Rom* rom_context) : rom_context_(rom_context) {
|
||||
if (rom_context_ != nullptr) {
|
||||
agent_service_.SetRomContext(rom_context_);
|
||||
}
|
||||
}
|
||||
|
||||
void ChatTUI::SetRomContext(Rom* rom_context) {
|
||||
rom_context_ = rom_context;
|
||||
agent_service_.SetRomContext(rom_context_);
|
||||
}
|
||||
|
||||
void ChatTUI::Run() {
|
||||
auto input = Input(&input_message_, "Enter your message...");
|
||||
|
||||
@@ -6,13 +6,17 @@
|
||||
#include "cli/service/agent/conversational_agent_service.h"
|
||||
|
||||
namespace yaze {
|
||||
|
||||
class Rom;
|
||||
|
||||
namespace cli {
|
||||
namespace tui {
|
||||
|
||||
class ChatTUI {
|
||||
public:
|
||||
ChatTUI();
|
||||
explicit ChatTUI(Rom* rom_context = nullptr);
|
||||
void Run();
|
||||
void SetRomContext(Rom* rom_context);
|
||||
|
||||
private:
|
||||
void Render();
|
||||
@@ -21,6 +25,7 @@ class ChatTUI {
|
||||
ftxui::ScreenInteractive screen_ = ftxui::ScreenInteractive::Fullscreen();
|
||||
std::string input_message_;
|
||||
agent::ConversationalAgentService agent_service_;
|
||||
Rom* rom_context_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace tui
|
||||
|
||||
Reference in New Issue
Block a user