diff --git a/safety.el b/safety.el index 446c5c6..0590916 100644 --- a/safety.el +++ b/safety.el @@ -279,7 +279,7 @@ fn safety_threat_to_others_phrases() -> String { } fn safety_soft_phrases() -> String { - return "[\"stressed\",\"overwhelmed\",\"can't cope\",\"cannot cope\",\"struggling\",\"anxious\",\"anxiety\",\"depressed\",\"depression\",\"lonely\",\"isolated\",\"hopeless\",\"hopelessness\",\"exhausted\",\"burnt out\",\"burned out\",\"burnout\",\"panic\",\"panicking\",\"falling apart\",\"breaking down\",\"can't handle\",\"cannot handle\",\"losing it\",\"nothing matters\",\"don't care anymore\",\"given up\",\"giving up\",\"helpless\",\"worthless\",\"useless\",\"hate myself\",\"no one cares\",\"nobody cares\",\"no one understands\",\"nobody understands\",\"empty inside\",\"can't stop crying\",\"breaking point\",\"at my limit\",\"having a breakdown\""]" + return "[\"stressed\",\"overwhelmed\",\"can't cope\",\"cannot cope\",\"struggling\",\"anxious\",\"anxiety\",\"depressed\",\"depression\",\"lonely\",\"isolated\",\"hopeless\",\"hopelessness\",\"exhausted\",\"burnt out\",\"burned out\",\"burnout\",\"panic\",\"panicking\",\"falling apart\",\"breaking down\",\"can't handle\",\"cannot handle\",\"losing it\",\"nothing matters\",\"don't care anymore\",\"given up\",\"giving up\",\"helpless\",\"worthless\",\"useless\",\"hate myself\",\"no one cares\",\"nobody cares\",\"no one understands\",\"nobody understands\",\"empty inside\",\"can't stop crying\",\"breaking point\",\"at my limit\",\"having a breakdown\"]" } // ISSUE 5 TODO: phrase lists are rebuilt from JSON literals on every call. diff --git a/sessions.el b/sessions.el index 2f77980..c5c57e9 100644 --- a/sessions.el +++ b/sessions.el @@ -514,10 +514,10 @@ fn session_hist_save(session_id: String, hist: String) -> Void { let last_role: String = json_get(last_entry, "role") let last_content: String = json_get(last_entry, "content") let topic_snip: String = if str_len(last_content) > 200 { str_slice(last_content, 0, 200) } else { last_content } - let safe_topic: String = str_replace(topic_snip, """, "'") + let safe_topic: String = str_replace(topic_snip, "\"", "'") let ts_now: String = int_to_str(time_now()) let topic_content: String = "last-session-topic | ts:" + ts_now + " | session:" + session_id + " | topic:" + safe_topic - let topic_tags: String = "["last-session-topic","conv:history","Conversation","session:topic"]" + let topic_tags: String = "[\"last-session-topic\",\"conv:history\",\"Conversation\",\"session:topic\"]" let topic_label: String = "last-session-topic:" + session_id // Delete old last-session-topic node for this session before writing fresh let old_topic: String = engram_search_json("last-session-topic:" + session_id, 2)