feat(asset): implement asset path resolution and streamline file loading
- Introduced a new utility function `FindAsset` in `PlatformPaths` to locate asset files across multiple standard directories, enhancing flexibility in asset management. - Updated various components to utilize `FindAsset` for loading configuration and prompt files, replacing hardcoded search paths with a more robust solution. - Improved error handling and logging for asset loading failures, ensuring clearer feedback during runtime. - Refactored existing code in `gemini_ai_service`, `prompt_builder`, and `platform_paths` to leverage the new asset resolution mechanism, promoting code consistency and maintainability.
This commit is contained in:
@@ -89,9 +89,11 @@ add_executable(
|
||||
cli/service/testing/test_suite_writer.cc
|
||||
)
|
||||
|
||||
# ============================================================================
|
||||
target_compile_definitions(z3ed PRIVATE YAZE_ASSETS_PATH="${CMAKE_SOURCE_DIR}/assets")
|
||||
|
||||
# ============================================================================
|
||||
# AI Agent Support (Consolidated via Z3ED_AI flag)
|
||||
# ============================================================================
|
||||
# ============================================================================
|
||||
if(Z3ED_AI OR YAZE_WITH_JSON)
|
||||
target_compile_definitions(z3ed PRIVATE YAZE_WITH_JSON)
|
||||
message(STATUS "✓ z3ed AI agent enabled (Ollama + Gemini support)")
|
||||
@@ -100,9 +102,9 @@ if(Z3ED_AI OR YAZE_WITH_JSON)
|
||||
target_link_libraries(z3ed PRIVATE nlohmann_json::nlohmann_json)
|
||||
endif()
|
||||
|
||||
# ============================================================================
|
||||
# ============================================================================
|
||||
# SSL/HTTPS Support (Optional - Required for Gemini API)
|
||||
# ============================================================================
|
||||
# ============================================================================
|
||||
# SSL is only enabled when AI features are active
|
||||
# Ollama (localhost) works without SSL, Gemini (HTTPS) requires it
|
||||
if((Z3ED_AI OR YAZE_WITH_JSON) AND (YAZE_WITH_GRPC OR Z3ED_AI))
|
||||
@@ -158,9 +160,9 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
# ============================================================================
|
||||
# ============================================================================
|
||||
# Optional gRPC Support for CLI Agent Test Command
|
||||
# ============================================================================
|
||||
# ============================================================================
|
||||
if(YAZE_WITH_GRPC)
|
||||
message(STATUS "Adding gRPC support to z3ed CLI")
|
||||
|
||||
@@ -183,4 +185,4 @@ if(YAZE_WITH_GRPC)
|
||||
libprotobuf)
|
||||
|
||||
message(STATUS "✓ gRPC CLI automation integrated")
|
||||
endif()
|
||||
endif()
|
||||
Reference in New Issue
Block a user