Files
yaze/src/cli/service/ai/service_factory_stub.cc
scawful 24078301be feat: implement conditional AI runtime features based on build configuration
- Added conditional compilation for AI services and callbacks based on the YAZE_AI_RUNTIME_AVAILABLE flag.
- Implemented stubs for AI service methods to return errors when the AI runtime is disabled, enhancing error handling.
- Updated GeminiAIService and OllamaAIService to provide appropriate responses when AI features are not available.
- Introduced a new service factory stub to create mock AI services when the runtime is disabled, improving testing capabilities.
2025-11-16 21:54:20 -05:00

28 lines
642 B
C++

#ifndef YAZE_AI_RUNTIME_AVAILABLE
#include "cli/service/ai/service_factory.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
namespace yaze::cli {
std::unique_ptr<AIService> CreateAIService() {
return std::make_unique<MockAIService>();
}
std::unique_ptr<AIService> CreateAIService(const AIServiceConfig&) {
return std::make_unique<MockAIService>();
}
absl::StatusOr<std::unique_ptr<AIService>> CreateAIServiceStrict(
const AIServiceConfig&) {
return absl::FailedPreconditionError(
"AI runtime features are disabled in this build");
}
} // namespace yaze::cli
#endif // !YAZE_AI_RUNTIME_AVAILABLE