mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-06-14 02:09:22 -04:00
refactor: Move QuickRefactor to Session way
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user