weijinglin opened a new pull request, #262:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/262

   # Add Path Checking Logic for Configuration Files
   
   ## Description
   This PR introduces path validation logic to ensure the application is 
running from the correct project root directory. It adds a new utility function 
to determine the project root and implements checks to prevent configuration 
loading from incorrect working directories.
   
   ## Changes
   - Added new utility function `get_project_root()` in 
`hugegraph_llm/utils/anchor.py` to reliably determine the project root directory
   - Updated configuration file path in `base_prompt_config.py` to use the 
correct path structure
   - Implemented working directory validation in 
`BasePromptConfig.ensure_yaml_file_exists()`
   - Added graceful error handling with informative messages when running from 
incorrect directory
   
   ## Technical Details
   - The path checking logic verifies if the current working directory matches 
the project root
   - If running from incorrect directory, the application will exit with a 
clear error message
   - Configuration file path has been updated to use the correct structure 
under `src/hugegraph_llm/resources/demo`
   
   ## Testing
   - [ ] Verify application runs correctly from project root
   - [ ] Confirm appropriate error message when running from incorrect directory
   - [ ] Test configuration file loading with the new path structure
   
   ## Impact
   This change improves the reliability of the application by ensuring 
configuration files are loaded from the correct location and provides better 
error handling for incorrect usage.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to