mirror of
https://github.com/wolfpld/tracy.git
synced 2026-01-18 17:11:26 +01:00
Allow attaching source code to LLM in simple view.
This commit is contained in:
@@ -1067,6 +1067,19 @@ void SourceView::Render( Worker& worker, View& view )
|
||||
stream.write( m_source.data(), m_source.data_size() );
|
||||
ImGui::SetClipboardText( stream.str().c_str() );
|
||||
}
|
||||
if( s_config.llm )
|
||||
{
|
||||
ImGui::SameLine();
|
||||
if( ImGui::SmallButton( ICON_FA_ROBOT ) )
|
||||
{
|
||||
nlohmann::json json = {
|
||||
{ "type", "source", },
|
||||
{ "file", m_source.filename(), },
|
||||
{ "code", std::string( m_source.data(), m_source.data_size() ) }
|
||||
};
|
||||
view.AddLlmAttachment( json );
|
||||
}
|
||||
}
|
||||
ImGui::PopFont();
|
||||
ImGui::SameLine();
|
||||
ImGui::Spacing();
|
||||
|
||||
Reference in New Issue
Block a user