Spaces:
Sleeping
Sleeping
Deploy Myco from CI
Browse files- game/engine.py +3 -4
game/engine.py
CHANGED
|
@@ -258,8 +258,7 @@ def myco_reply(message=None, history=None, current=None, collection=None, positi
|
|
| 258 |
next_history = [*current_history, (clean_message, None)]
|
| 259 |
context = _companion_context(current, collection, current_history, position)
|
| 260 |
answer = _companion_answer(clean_message, current, context)
|
| 261 |
-
return "", [*
|
| 262 |
-
|
| 263 |
|
| 264 |
companion_reply = myco_reply
|
| 265 |
|
|
@@ -839,11 +838,11 @@ def _study_hint(rarity):
|
|
| 839 |
|
| 840 |
|
| 841 |
def _assistant_message(content):
|
| 842 |
-
return
|
| 843 |
|
| 844 |
|
| 845 |
def _append_assistant(history, content):
|
| 846 |
-
return [*_safe_history(history),
|
| 847 |
|
| 848 |
|
| 849 |
def _safe_collection(collection):
|
|
|
|
| 258 |
next_history = [*current_history, (clean_message, None)]
|
| 259 |
context = _companion_context(current, collection, current_history, position)
|
| 260 |
answer = _companion_answer(clean_message, current, context)
|
| 261 |
+
return "", [*current_history, {"role": "user", "content": clean_message}, {"role": "assistant", "content": answer}]
|
|
|
|
| 262 |
|
| 263 |
companion_reply = myco_reply
|
| 264 |
|
|
|
|
| 838 |
|
| 839 |
|
| 840 |
def _assistant_message(content):
|
| 841 |
+
return {"role": "assistant", "content": content}
|
| 842 |
|
| 843 |
|
| 844 |
def _append_assistant(history, content):
|
| 845 |
+
return [*_safe_history(history), {"role": "assistant", "content": content}]
|
| 846 |
|
| 847 |
|
| 848 |
def _safe_collection(collection):
|