ocdevel / gnothi

Gnothi is an open-source AI journal and toolkit for self-discovery. If you're interested in getting involved, we'd love to hear from you.

Home Page:https://gnothiai.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error Report: TypeError: Cannot read properties of undefined (reading 'replace')

lefnire opened this issue · comments

Error Report: TypeError: Cannot read properties of undefined (reading 'replace')
insights_get_response

It popped up right after I submitted the day's journal and returned to the home page, in the same moment as the AI-generated > > > snapshot appeared in the Summary and Themes module, and possibly the same moment as the AI-generated entry title. I was also starting to click through my behavior tracking, and had just completed my third one.


This is due to regex parsing out the result of the summarizer model, expecting without flaw to receive Title, Summary, Themes, Emotion. Of course, this is rarely flawless (unless using OpenAI via premium), and needs to account for cases where it doesn't follow the regex rules.

When using Llama 2 or GPT, the prompt should be converted from "please follow the following weird format" to "please output as JSON", which we can parse directly

Roundabout fix: I've completely ditched pre-trained huggingface summarizer, it's just too brittle and has been the majority of my dev effort since I've started this project. It's all in on LLMs, baby. So currently we launched a setup where you either upgrade or use credits to activate Generative AI, which was previously only used for Prompt, but is now used for summary. When I add Llama2 in, I'll revisit how we want to handle free accounts. Track that #160