feature: refactor prompts into prompt config #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
Hi everyone, I'm a first-time contributor here. While working with the Pippin framework, I found that fine-tuning prompts for different activities could get a bit messy. This PR refactors the prompt loading functionality by moving all prompts into a dedicated prompts_config.json file. This centralises the prompt configuration and improves the flexibility of loading different prompts based on activity names.
To facilitate reading the prompts, I've introduced a PromptLoader class that loads the prompts from the configuration file. While I believe this abstraction will make configuring activities easier with minimal changes to existing logic, I'm open to discussing whether this approach is the best way to handle prompts. For now, the DailyThoughtActivity class has been updated to use this new loader.
I think there are a few considerations when abstracting out prompts:
Before I proceed with updating the rest of the activity classes, I'd love feedback on the approach and any suggestions for improvement.
I apologise in advance for any mistakes, as this is my first PR in an open-source project. I'm eager to learn from the community and am open to any guidance or corrections!
Type of Change
How Has This Been Tested?
Verified that the prompts are correctly loaded from
prompts_config.json
using the PromptLoader.Ensured that the DailyThoughtActivity class correctly fetches the prompts based on the activity name.
Tested the prompt retrieval process for different activities to ensure no errors occur when fetching prompts.
Test A: Validate prompt loading from the new prompts_config.json file.
Test B: Ensure no issues occur when running the DailyThoughtActivity with the newly refactored prompt loading process.
Checklist:
Screenshots (if applicable):
Add any relevant screenshots here.
Additional Notes:
Add any other information that is important to this pull request.