mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-12-01 06:52:53 -05:00
fix: check request id of thinking block
This commit is contained in:
@ -307,14 +307,14 @@ void ClientInterface::sendMessage(
|
|||||||
connect(
|
connect(
|
||||||
provider,
|
provider,
|
||||||
&LLMCore::Provider::thinkingBlockReceived,
|
&LLMCore::Provider::thinkingBlockReceived,
|
||||||
m_chatModel,
|
this,
|
||||||
&ChatModel::addThinkingBlock,
|
&ClientInterface::handleThinkingBlockReceived,
|
||||||
Qt::UniqueConnection);
|
Qt::UniqueConnection);
|
||||||
connect(
|
connect(
|
||||||
provider,
|
provider,
|
||||||
&LLMCore::Provider::redactedThinkingBlockReceived,
|
&LLMCore::Provider::redactedThinkingBlockReceived,
|
||||||
m_chatModel,
|
this,
|
||||||
&ChatModel::addRedactedThinkingBlock,
|
&ClientInterface::handleRedactedThinkingBlockReceived,
|
||||||
Qt::UniqueConnection);
|
Qt::UniqueConnection);
|
||||||
|
|
||||||
provider->sendRequest(requestId, config.url, config.providerRequest);
|
provider->sendRequest(requestId, config.url, config.providerRequest);
|
||||||
@ -475,6 +475,29 @@ void ClientInterface::handleCleanAccumulatedData(const QString &requestId)
|
|||||||
LOG_MESSAGE(QString("Cleared accumulated responses for continuation request %1").arg(requestId));
|
LOG_MESSAGE(QString("Cleared accumulated responses for continuation request %1").arg(requestId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientInterface::handleThinkingBlockReceived(
|
||||||
|
const QString &requestId, const QString &thinking, const QString &signature)
|
||||||
|
{
|
||||||
|
if (!m_activeRequests.contains(requestId)) {
|
||||||
|
LOG_MESSAGE(QString("Ignoring thinking block for non-chat request: %1").arg(requestId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_chatModel->addThinkingBlock(requestId, thinking, signature);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientInterface::handleRedactedThinkingBlockReceived(
|
||||||
|
const QString &requestId, const QString &signature)
|
||||||
|
{
|
||||||
|
if (!m_activeRequests.contains(requestId)) {
|
||||||
|
LOG_MESSAGE(
|
||||||
|
QString("Ignoring redacted thinking block for non-chat request: %1").arg(requestId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_chatModel->addRedactedThinkingBlock(requestId, signature);
|
||||||
|
}
|
||||||
|
|
||||||
bool ClientInterface::isImageFile(const QString &filePath) const
|
bool ClientInterface::isImageFile(const QString &filePath) const
|
||||||
{
|
{
|
||||||
static const QSet<QString> imageExtensions = {"png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"};
|
static const QSet<QString> imageExtensions = {"png", "jpg", "jpeg", "gif", "webp", "bmp", "svg"};
|
||||||
|
|||||||
@ -63,6 +63,9 @@ private slots:
|
|||||||
void handleFullResponse(const QString &requestId, const QString &fullText);
|
void handleFullResponse(const QString &requestId, const QString &fullText);
|
||||||
void handleRequestFailed(const QString &requestId, const QString &error);
|
void handleRequestFailed(const QString &requestId, const QString &error);
|
||||||
void handleCleanAccumulatedData(const QString &requestId);
|
void handleCleanAccumulatedData(const QString &requestId);
|
||||||
|
void handleThinkingBlockReceived(
|
||||||
|
const QString &requestId, const QString &thinking, const QString &signature);
|
||||||
|
void handleRedactedThinkingBlockReceived(const QString &requestId, const QString &signature);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void handleLLMResponse(const QString &response, const QJsonObject &request);
|
void handleLLMResponse(const QString &response, const QJsonObject &request);
|
||||||
|
|||||||
Reference in New Issue
Block a user