mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-22 02:04:23 +00:00
Ignore all-newline message chunks at the beginning of LLM content.
DeepSeek 4 Flash likes to send "\n\n" as content between the reasoning and tool call sections.
This commit is contained in:
@@ -1395,13 +1395,20 @@ void TracyLlm::AppendResponse( const char* name, const nlohmann::json& delta )
|
||||
{
|
||||
assert( back[name].is_string() );
|
||||
back[name].get_ref<std::string&>().append( str );
|
||||
m_usedCtx++;
|
||||
}
|
||||
else
|
||||
{
|
||||
back[name] = std::move( str );
|
||||
for( auto c : str )
|
||||
{
|
||||
if( c != '\n' )
|
||||
{
|
||||
back[name] = std::move( str );
|
||||
m_usedCtx++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_usedCtx++;
|
||||
}
|
||||
else if( json.is_array() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user