hiyaryan / the-cdj

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!!
https://thecdj.app
3 stars 0 forks source link

Add constraints to LLM and Account components. #29

Closed hiyaryan closed 9 months ago

hiyaryan commented 9 months ago

This PR adds constraints to the LLM components based on their capabilities. The only reliable models that can return JSON are gpt-3.5-turbo-1106 and gpt-4-1106-preview. Since analysis features depend on JSON, these models are the only models that can make analyses.

The initial commit of this PR updates the LLM analysis model TextField to a Select with the Select MenuItems being the models mentioned above.

hiyaryan commented 9 months ago

The previous commits of this PR improves the implementation of the new Select component by improving readability using separation of concern and reusing code used by other children components found to offer the same functionality.

Additionally, empty strings are now allowed to be submitted provided flash messages are being used. This allows empty strings to delete certain fields that are not required like LLM and API key config fields. The only values not allowed are null and undefined fields which are used for filtering and request body building. Now the server will return flash messages regarding requirements.

hiyaryan commented 9 months ago

The final commits to this PR disables buttons on analysis, chat, and edit submissions and adds progress bar visualizers to indicate their request is being processed. Indeterminate linear progress bar visualizers are added to new entry, new chat, edit, and account update. An indeterminate circular progress bar is added to the left of the Recent Thoughts h2 when a deletion of a thought is performed. When updating account. if there is nothing in the request body, the button does nothing. It was considered the button should be disabled, but a blank Review page should be enough of an indication why the update button is not doing anything.