refactor: Move QuickRefactor to Session way

This commit is contained in:
Petr Mironychev
2026-06-11 14:18:44 +02:00
parent 7bfe9d6f0e
commit e65ac23e66
7 changed files with 83 additions and 87 deletions

View File

@@ -134,17 +134,6 @@ LLMQore::RequestID Session::sendText(const QString &text)
return send(std::move(blocks));
}
LLMQore::RequestID Session::sendCompletion(Templates::ContextData ctx)
{
if (!isValid()) {
m_lastError = makeError(ErrorCategory::Config, invalidReason());
return {};
}
if (isInFlight())
cancel();
return dispatchContext(std::move(ctx), /*tools=*/false);
}
LLMQore::RequestID Session::send(
std::vector<std::unique_ptr<LLMQore::ContentBlock>> userBlocks,
std::optional<bool> toolsOverride)
@@ -290,6 +279,12 @@ Templates::ContextData Session::buildLegacyContext(
if (m.role() == Message::Role::System)
continue;
if (auto *cc = m.lastBlockOfType<CompletionContent>()) {
ctx.prefix = cc->prefix();
ctx.suffix = cc->suffix();
continue;
}
QVector<ContentBlockEntry> blockEntries;
for (const auto &blockPtr : m.blocks()) {