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 distorted thinking and finding alternative modes of thought (i.e. reframing) while cognitive distortions are occurring. The CDJ does that work for you. -- The CDJ is in beta testing!!
This PR enforces json enabled gpts to return all required analysis topics. There are three topics that form an analysis of a thought containing a cognitive distortion,
A reframing or an example of what a healthy thought looks like in context
A label and description of the cognitive distortion e.g. over-generalization, all-or-nothing thinking, etc.
An assessment of the impact having that cognitive distortion may cause
If the thought does not contain a cognitive distortion, the gpt returns a single topic
A positive affirmation or encouragement
This has been enabled through removing analyis_content from the instruction format and replaces it with reframed_thought, distortion_analysis, and impact_assessment used to form the analysis_content stored in the db on return. By concatenating these topics together, it was made possible to keep analysis_content, which is used throughout several places on the frontend and backend. So these changes only needed to occur in one spot, in the entryAnalysis model methods.
As a result of forming the analysis_content after retrieving the gpt content, json is being parsed within the entryAnalysis model methods previously parsed in the entry controllers. This required going through each of those controllers and removing the JSON parsing method.
This PR closes #93. See the discussion there for more information on how the prompt has been changed. Note that the prompt was slowly iterated over to form the current working one so not all prompt attempts have been shown there.
This PR enforces json enabled gpts to return all required analysis topics. There are three topics that form an analysis of a thought containing a cognitive distortion,
If the thought does not contain a cognitive distortion, the gpt returns a single topic
This has been enabled through removing
analyis_content
from the instruction format and replaces it withreframed_thought
,distortion_analysis
, andimpact_assessment
used to form theanalysis_content
stored in the db on return. By concatenating these topics together, it was made possible to keepanalysis_content
, which is used throughout several places on the frontend and backend. So these changes only needed to occur in one spot, in theentryAnalysis
model methods.As a result of forming the
analysis_content
after retrieving the gpt content, json is being parsed within theentryAnalysis
model methods previously parsed in the entry controllers. This required going through each of those controllers and removing the JSON parsing method.This PR closes #93. See the discussion there for more information on how the prompt has been changed. Note that the prompt was slowly iterated over to form the current working one so not all prompt attempts have been shown there.