mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-05-28 03:10:28 -04:00
🐛 fix: Removing message from chat after complete receiving
This commit is contained in:
parent
6503887091
commit
36d5242a1f
@ -148,11 +148,16 @@ void ClientInterface::handleLLMResponse(const QString &response,
|
|||||||
const QJsonObject &request,
|
const QJsonObject &request,
|
||||||
bool isComplete)
|
bool isComplete)
|
||||||
{
|
{
|
||||||
QString messageId = request["id"].toString();
|
const auto message = response.trimmed();
|
||||||
m_chatModel->addMessage(response.trimmed(), ChatModel::ChatRole::Assistant, messageId);
|
|
||||||
|
|
||||||
if (isComplete) {
|
if (!message.isEmpty()) {
|
||||||
LOG_MESSAGE("Message completed. Final response for message " + messageId + ": " + response);
|
QString messageId = request["id"].toString();
|
||||||
|
m_chatModel->addMessage(message, ChatModel::ChatRole::Assistant, messageId);
|
||||||
|
|
||||||
|
if (isComplete) {
|
||||||
|
LOG_MESSAGE(
|
||||||
|
"Message completed. Final response for message " + messageId + ": " + response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user