| 527 | } |
| 528 | |
| 529 | void ClientInterface::handleFullResponse(const QString &requestId, const QString &fullText) |
| 530 | { |
| 531 | auto it = m_activeRequests.find(requestId); |
| 532 | if (it == m_activeRequests.end()) |
| 533 | return; |
| 534 | |
| 535 | const RequestContext &ctx = it.value(); |
| 536 | |
| 537 | QString finalText = !fullText.isEmpty() ? fullText : m_accumulatedResponses[requestId]; |
| 538 | |
| 539 | QString applyError; |
| 540 | bool applySuccess |
| 541 | = Context::ChangesManager::instance().applyPendingEditsForRequest(requestId, &applyError); |
| 542 | |
| 543 | if (!applySuccess) { |
| 544 | LOG_MESSAGE(QString("Some edits for request %1 were not auto-applied: %2") |
| 545 | .arg(requestId, applyError)); |
| 546 | } |
| 547 | |
| 548 | LOG_MESSAGE( |
| 549 | "Message completed. Final response for message " + ctx.originalRequest["id"].toString() |
| 550 | + ": " + finalText); |
| 551 | emit messageReceivedCompletely(); |
| 552 | |
| 553 | m_activeRequests.erase(it); |
| 554 | m_accumulatedResponses.remove(requestId); |
| 555 | m_awaitingContinuation.remove(requestId); |
| 556 | } |
| 557 | |
| 558 | void ClientInterface::handleRequestFinalized( |
| 559 | const ::LLMQore::RequestID &requestId, const ::LLMQore::CompletionInfo &info) |
nothing calls this directly
no test coverage detected