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.
This commit is contained in:
@@ -1,5 +1,21 @@
|
||||
#include "cli/service/agent/proposal_executor.h"
|
||||
|
||||
#ifndef YAZE_AI_RUNTIME_AVAILABLE
|
||||
|
||||
#include "absl/status/status.h"
|
||||
|
||||
namespace yaze::cli::agent {
|
||||
|
||||
absl::StatusOr<ProposalCreationResult> CreateProposalFromAgentResponse(
|
||||
const ProposalCreationRequest&) {
|
||||
return absl::FailedPreconditionError(
|
||||
"AI runtime features are disabled in this build");
|
||||
}
|
||||
|
||||
} // namespace yaze::cli::agent
|
||||
|
||||
#else // YAZE_AI_RUNTIME_AVAILABLE
|
||||
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
@@ -180,3 +196,5 @@ absl::StatusOr<ProposalCreationResult> CreateProposalFromAgentResponse(
|
||||
} // namespace agent
|
||||
} // namespace cli
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_AI_RUNTIME_AVAILABLE
|
||||
|
||||
Reference in New Issue
Block a user