Add step 625 tool call visualization model

This commit is contained in:
Bill
2026-02-17 21:10:53 -07:00
parent 49b80096f1
commit f770f173a0
6 changed files with 301 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
#pragma once
// Step 624: Agent Chat Panel model
#include "AgentToolCallVisualization.h"
#include <cctype>
#include <string>
#include <vector>
@@ -19,6 +21,7 @@ struct AgentChatMessage {
struct AgentChatState {
std::vector<AgentChatMessage> messages;
std::vector<AgentToolCallView> toolCalls;
std::string draftInput;
bool autoScroll = true;
bool open = false;
@@ -52,6 +55,20 @@ public:
state->autoScroll = true;
}
static void addToolCall(AgentChatState* state,
const std::string& toolName,
const json& input,
const json& output,
const std::string& timestamp) {
if (!state) return;
AgentToolCallView view = AgentToolCallVisualization::build(toolName, input, output);
state->toolCalls.push_back(view);
state->messages.push_back({AgentChatRole::Tool,
AgentToolCallVisualization::inlineLabel(view),
timestamp});
state->autoScroll = true;
}
static const char* roleLabel(AgentChatRole role) {
if (role == AgentChatRole::User) return "user";
if (role == AgentChatRole::Assistant) return "assistant";