mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-02-18 21:13:04 -05:00
fix: Check Request id for tool block
This commit is contained in:
@ -289,14 +289,14 @@ void ClientInterface::sendMessage(
|
|||||||
connect(
|
connect(
|
||||||
provider,
|
provider,
|
||||||
&LLMCore::Provider::toolExecutionStarted,
|
&LLMCore::Provider::toolExecutionStarted,
|
||||||
m_chatModel,
|
this,
|
||||||
&ChatModel::addToolExecutionStatus,
|
&ClientInterface::handleToolExecutionStarted,
|
||||||
Qt::UniqueConnection);
|
Qt::UniqueConnection);
|
||||||
connect(
|
connect(
|
||||||
provider,
|
provider,
|
||||||
&LLMCore::Provider::toolExecutionCompleted,
|
&LLMCore::Provider::toolExecutionCompleted,
|
||||||
m_chatModel,
|
this,
|
||||||
&ChatModel::updateToolResult,
|
&ClientInterface::handleToolExecutionCompleted,
|
||||||
Qt::UniqueConnection);
|
Qt::UniqueConnection);
|
||||||
connect(
|
connect(
|
||||||
provider,
|
provider,
|
||||||
@ -498,6 +498,31 @@ void ClientInterface::handleRedactedThinkingBlockReceived(
|
|||||||
m_chatModel->addRedactedThinkingBlock(requestId, signature);
|
m_chatModel->addRedactedThinkingBlock(requestId, signature);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ClientInterface::handleToolExecutionStarted(
|
||||||
|
const QString &requestId, const QString &toolId, const QString &toolName)
|
||||||
|
{
|
||||||
|
if (!m_activeRequests.contains(requestId)) {
|
||||||
|
LOG_MESSAGE(QString("Ignoring tool execution start for non-chat request: %1").arg(requestId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_chatModel->addToolExecutionStatus(requestId, toolId, toolName);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClientInterface::handleToolExecutionCompleted(
|
||||||
|
const QString &requestId,
|
||||||
|
const QString &toolId,
|
||||||
|
const QString &toolName,
|
||||||
|
const QString &toolOutput)
|
||||||
|
{
|
||||||
|
if (!m_activeRequests.contains(requestId)) {
|
||||||
|
LOG_MESSAGE(QString("Ignoring tool execution result for non-chat request: %1").arg(requestId));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_chatModel->updateToolResult(requestId, toolId, toolName, toolOutput);
|
||||||
|
}
|
||||||
|
|
||||||
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"};
|
||||||
|
|||||||
@ -66,6 +66,13 @@ private slots:
|
|||||||
void handleThinkingBlockReceived(
|
void handleThinkingBlockReceived(
|
||||||
const QString &requestId, const QString &thinking, const QString &signature);
|
const QString &requestId, const QString &thinking, const QString &signature);
|
||||||
void handleRedactedThinkingBlockReceived(const QString &requestId, const QString &signature);
|
void handleRedactedThinkingBlockReceived(const QString &requestId, const QString &signature);
|
||||||
|
void handleToolExecutionStarted(
|
||||||
|
const QString &requestId, const QString &toolId, const QString &toolName);
|
||||||
|
void handleToolExecutionCompleted(
|
||||||
|
const QString &requestId,
|
||||||
|
const QString &toolId,
|
||||||
|
const QString &toolName,
|
||||||
|
const QString &toolOutput);
|
||||||
|
|
||||||
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