The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling and reframing distorted thinking when you've been thinking this way your whole life. The CDJ can help with that 🧠✨ -- v2 is in development!
This PR fixes a bug that causes the users session to stall. This occurs in two places.
When the gpt does not return the response data structure as expected. While it usually always returns json, on several occasions depending on the users input, the gpt will not always return the required keys.
If "test" is used as an entry, there's nothing to analyze, so the gpt returns nothing. The issue with this is that a title was required throwing a validation error.
When a first entry is posted.
The entryAnalysis validation looks for a required analysis_content field. There is none until the gpt creates one so validation throws an error.
These errors arose after updating the analysis seed. To fix these problems, required properties have been removed from title and anaysis_content and replaced with default values.
This PR fixes a bug that causes the users session to stall. This occurs in two places.
If "test" is used as an entry, there's nothing to analyze, so the gpt returns nothing. The issue with this is that a title was required throwing a validation error.
The entryAnalysis validation looks for a required analysis_content field. There is none until the gpt creates one so validation throws an error.
These errors arose after updating the analysis seed. To fix these problems, required properties have been removed from title and anaysis_content and replaced with default values.