mirror of
https://github.com/wolfpld/tracy.git
synced 2026-11-13 11:25:51 +00:00
Check if the response contains finish_reason before getting its value.
This commit is contained in:
@@ -1050,7 +1050,7 @@ bool TracyLlm::OnResponse( const nlohmann::json& json )
|
||||
AppendResponse( "reasoning_content", delta );
|
||||
AppendResponse( "tool_calls", delta );
|
||||
|
||||
done = !node["finish_reason"].empty();
|
||||
done = node.contains( "finish_reason" ) && !node["finish_reason"].empty();
|
||||
}
|
||||
}
|
||||
else if( json.contains( "error" ) )
|
||||
|
||||
Reference in New Issue
Block a user