refactor: Move to agent architecture

This commit is contained in:
Petr Mironychev
2026-05-30 14:50:49 +02:00
parent 34ce787320
commit ccc2ec2e80
364 changed files with 10801 additions and 19020 deletions

View File

@@ -34,9 +34,8 @@ QString AgentConfig::validate(const AgentConfig &config)
return QStringLiteral("Agent config '%1' has no model").arg(config.name);
if (config.endpoint.isEmpty())
return QStringLiteral("Agent config '%1' has no endpoint").arg(config.name);
if (config.messageFormat.isEmpty()) {
return QStringLiteral("Agent config '%1' has no [template].message_format")
.arg(config.name);
if (config.body.isEmpty()) {
return QStringLiteral("Agent config '%1' has no [body]").arg(config.name);
}
return {};
}
@@ -56,6 +55,9 @@ Agent::Agent(AgentConfig config, Providers::Provider *providerOwned, QObject *pa
return;
}
m_provider->setParent(this);
m_provider->setPromptCaching(
m_config.cachePrompt, m_config.cacheTtl == QLatin1StringView{"1h"},
m_config.cacheBreakpoints);
QString tmplErr;
m_promptTemplate = JsonPromptTemplate::fromConfig(m_config, &tmplErr);