Check if the response contains finish_reason before getting its value.

This commit is contained in:
Bartosz Taudul
2026-02-05 18:31:05 +01:00
parent 66cc77bd5f
commit a31ab53d26
+1 -1
View File
@@ -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" ) )