diff --git a/profiler/src/profiler/TracyLlmChat.cpp b/profiler/src/profiler/TracyLlmChat.cpp index 1e7715a6..0085277e 100644 --- a/profiler/src/profiler/TracyLlmChat.cpp +++ b/profiler/src/profiler/TracyLlmChat.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include @@ -139,12 +140,20 @@ bool TracyLlmChat::Turn( TurnRole role, const std::string& content ) } else if( role == TurnRole::Attachment ) { + constexpr auto tagSize = sizeof( "\n" ) - 1; + + auto j = nlohmann::json::parse( content.c_str() + tagSize, content.c_str() + content.size() ); + const auto& type = j["type"].get_ref(); + NormalScope(); ImGui::PushID( m_thinkIdx++ ); - if( ImGui::TreeNode( "Attachment" ) ) + const bool expand = ImGui::TreeNode( "Attachment" ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%s)", type.c_str() ); + if( expand ) { ImGui::PushFont( g_fonts.mono ); - ImGui::TextWrapped( "%s", content.c_str() + sizeof( "\n" ) - 1 ); + ImGui::TextWrapped( "%s", content.c_str() + tagSize ); ImGui::PopFont(); ImGui::TreePop(); }