cognovi-ai / 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

Chat #5

Closed hiyaryan closed 10 months ago

hiyaryan commented 10 months ago

This PR adds initial chat functionality to the frontend and backend. Chat messages are now displayed above the chat box of the Thought Analysis component and every user message is packaged with an LLM response.

user_id is removed from the entryConversation model and llm_response is added. user_id is not necessary since this is a one-on-one conversation with the LLM for a particular entry.

Routes are added to create a new conversation or update an existing one and retrieve the entry conversation.

Chat data is retrieved on the Analysis view and passed as a prop to its child, Messages, component. Originally, messages made the fetch request but the state is being used in multiple child components.

If the user enters a new thought while in the focusing view, the focusing is set to false and the focusing view closes.

hiyaryan commented 10 months ago

Final commits updates and adds styles to the entries page. See commit messages.