feat: Add request validator

This commit is contained in:
Petr Mironychev
2024-12-15 02:08:35 +01:00
parent 10e8b16caf
commit 7376a11a05
12 changed files with 194 additions and 1 deletions

View File

@ -195,6 +195,12 @@ void LLMClientInterface::handleCompletion(const QJsonObject &request)
config.promptTemplate->prepareRequest(config.providerRequest, updatedContext);
config.provider->prepareRequest(config.providerRequest, LLMCore::RequestType::Fim);
auto errors = config.provider->validateRequest(config.providerRequest, promptTemplate->type());
if (!errors.isEmpty()) {
LOG_MESSAGE("Validate errors for fim request:");
LOG_MESSAGES(errors);
return;
}
m_requestHandler.sendLLMRequest(config, request);
}