From a9d696c9e37605abb1451ae0c926dc86baa12334 Mon Sep 17 00:00:00 2001 From: Sampson Date: Tue, 17 Dec 2024 07:20:16 -0600 Subject: [PATCH] presubmit fixes --- components/ai_chat/core/browser/BUILD.gn | 12 ++++++------ .../ai_chat/core/browser/engine/byom_api_client.cc | 2 +- .../core/browser/engine/engine_consumer_byom.h | 2 +- components/ai_chat/core/browser/model_service.cc | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/ai_chat/core/browser/BUILD.gn b/components/ai_chat/core/browser/BUILD.gn index 5a5a6bd8ec2c..19e352882804 100644 --- a/components/ai_chat/core/browser/BUILD.gn +++ b/components/ai_chat/core/browser/BUILD.gn @@ -26,20 +26,20 @@ static_library("browser") { "constants.h", "conversation_handler.cc", "conversation_handler.h", + "engine/byom_api_client.cc", + "engine/byom_api_client.h", "engine/conversation_api_client.cc", "engine/conversation_api_client.h", "engine/engine_consumer.cc", "engine/engine_consumer.h", + "engine/engine_consumer_byom.cc", + "engine/engine_consumer_byom.h", "engine/engine_consumer_claude.cc", "engine/engine_consumer_claude.h", "engine/engine_consumer_conversation_api.cc", "engine/engine_consumer_conversation_api.h", "engine/engine_consumer_llama.cc", "engine/engine_consumer_llama.h", - "engine/engine_consumer_byom.cc", - "engine/engine_consumer_byom.h", - "engine/byom_api_client.cc", - "engine/byom_api_client.h", "engine/remote_completion_client.cc", "engine/remote_completion_client.h", "local_models_updater.cc", @@ -135,12 +135,12 @@ if (!is_ios) { "ai_chat_service_unittest.cc", "associated_content_driver_unittest.cc", "conversation_handler_unittest.cc", + "engine/byom_api_client_unittest.cc", "engine/conversation_api_client_unittest.cc", + "engine/engine_consumer_byom_unittest.cc", "engine/engine_consumer_claude_unittest.cc", "engine/engine_consumer_conversation_api_unittest.cc", "engine/engine_consumer_llama_unittest.cc", - "engine/engine_consumer_byom_unittest.cc", - "engine/byom_api_client_unittest.cc", "engine/test_utils.cc", "engine/test_utils.h", "local_models_updater_unittest.cc", diff --git a/components/ai_chat/core/browser/engine/byom_api_client.cc b/components/ai_chat/core/browser/engine/byom_api_client.cc index 0ae296dafebd..099b93ec80aa 100644 --- a/components/ai_chat/core/browser/engine/byom_api_client.cc +++ b/components/ai_chat/core/browser/engine/byom_api_client.cc @@ -130,7 +130,7 @@ void BYOMAPIClient::PerformRequest( } void BYOMAPIClient::OnQueryCompleted(GenerationCompletedCallback callback, - APIRequestResult result) { + APIRequestResult result) { const bool success = result.Is2XXResponseCode(); // Handle successful request if (success) { diff --git a/components/ai_chat/core/browser/engine/engine_consumer_byom.h b/components/ai_chat/core/browser/engine/engine_consumer_byom.h index 9e4c9c0851bb..5ba2a7c1e226 100644 --- a/components/ai_chat/core/browser/engine/engine_consumer_byom.h +++ b/components/ai_chat/core/browser/engine/engine_consumer_byom.h @@ -12,8 +12,8 @@ #include "base/memory/weak_ptr.h" #include "brave/components/ai_chat/core/browser/ai_chat_credential_manager.h" -#include "brave/components/ai_chat/core/browser/engine/engine_consumer.h" #include "brave/components/ai_chat/core/browser/engine/byom_api_client.h" +#include "brave/components/ai_chat/core/browser/engine/engine_consumer.h" #include "brave/components/ai_chat/core/common/mojom/ai_chat.mojom-forward.h" #include "brave/components/ai_chat/core/common/mojom/ai_chat.mojom.h" diff --git a/components/ai_chat/core/browser/model_service.cc b/components/ai_chat/core/browser/model_service.cc index a8b5abfba94d..1086ed28f22f 100644 --- a/components/ai_chat/core/browser/model_service.cc +++ b/components/ai_chat/core/browser/model_service.cc @@ -30,10 +30,10 @@ #include "base/values.h" #include "brave/components/ai_chat/core/browser/constants.h" #include "brave/components/ai_chat/core/browser/engine/engine_consumer.h" +#include "brave/components/ai_chat/core/browser/engine/engine_consumer_byom.h" #include "brave/components/ai_chat/core/browser/engine/engine_consumer_claude.h" #include "brave/components/ai_chat/core/browser/engine/engine_consumer_conversation_api.h" #include "brave/components/ai_chat/core/browser/engine/engine_consumer_llama.h" -#include "brave/components/ai_chat/core/browser/engine/engine_consumer_byom.h" #include "brave/components/ai_chat/core/browser/model_validator.h" #include "brave/components/ai_chat/core/browser/utils.h" #include "brave/components/ai_chat/core/common/features.h" @@ -662,7 +662,7 @@ std::unique_ptr ModelService::GetEngineForModel( auto& custom_model_opts = model->options->get_custom_model_options(); DVLOG(1) << "Started AI engine: custom"; engine = std::make_unique(*custom_model_opts, - url_loader_factory); + url_loader_factory); } return engine;