Spaces:
Running
Running
Commit ·
e417ea9
1
Parent(s): c3f416e
memory persistence, flex-based grid ui
Browse files- core/conversation_manager.py +12 -12
core/conversation_manager.py
CHANGED
|
@@ -54,18 +54,18 @@ class ConversationState:
|
|
| 54 |
"text": text
|
| 55 |
})
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
|
| 71 |
-
|
|
|
|
| 54 |
"text": text
|
| 55 |
})
|
| 56 |
|
| 57 |
+
# ---------------------------------------------------------------
|
| 58 |
+
# REHYDRAION - CONVERT DICT/JSON BACK TO ConversationState Object
|
| 59 |
+
# ---------------------------------------------------------------
|
| 60 |
+
def from_dict(data):
|
| 61 |
+
state = ConversationState()
|
| 62 |
|
| 63 |
+
state.history = data.get("history", [])
|
| 64 |
+
state.agent_logs = data.get("agents", {})
|
| 65 |
+
state.initial_query = data.get("history", [{}])[0].get("content", "")
|
| 66 |
|
| 67 |
+
# restore flags
|
| 68 |
+
state.conversation_started = True
|
| 69 |
+
state.current_agent = "jung"
|
| 70 |
|
| 71 |
+
return state
|