This pull request introduces two key enhancements to the parsing of prompt.txt files used in our workflow processes. It addresses the issues outlined in https://github.com/devchat-ai/devchat/issues/276 by improving path resolution and adding support for the @file@ syntax within the content of prompt.txt.
Improvements:
Path Resolution: We've fixed the issue where the parser was failing to accurately locate prompt.txt. The use of os.path.expanduser ensures that user directories are correctly resolved, enhancing the reliability of path access across different environments.
@file@ Syntax Support: The new parsing logic recognizes and substitutes the @file@ tags with the content of the actual files referenced. This allows for more dynamic and flexible workflow scripting, as files can be directly embedded into the context provided by prompt.txt.
Notes:
Special attention has been paid to ensuring that, if a referenced file does not exist or cannot be accessed, the @file@ tag remains unaltered, preserving the original intent.
A thorough testing strategy was followed to validate these improvements across various environments.
The documentation will need to be updated to reflect the new features and the modifications to the parsing process.
This pull request introduces two key enhancements to the parsing of
prompt.txt
files used in our workflow processes. It addresses the issues outlined in https://github.com/devchat-ai/devchat/issues/276 by improving path resolution and adding support for the@file@
syntax within the content ofprompt.txt
.Improvements:
Path Resolution: We've fixed the issue where the parser was failing to accurately locate
prompt.txt
. The use ofos.path.expanduser
ensures that user directories are correctly resolved, enhancing the reliability of path access across different environments.@file@ Syntax Support: The new parsing logic recognizes and substitutes the
@file@
tags with the content of the actual files referenced. This allows for more dynamic and flexible workflow scripting, as files can be directly embedded into the context provided byprompt.txt
.Notes:
Special attention has been paid to ensuring that, if a referenced file does not exist or cannot be accessed, the
@file@
tag remains unaltered, preserving the original intent.A thorough testing strategy was followed to validate these improvements across various environments.
The documentation will need to be updated to reflect the new features and the modifications to the parsing process.
Closes https://github.com/devchat-ai/devchat/issues/276.