Spaces:
Sleeping

byte-vortex commited on
Commit
52b8d85
·
verified ·
1 Parent(s): e93932d

Deploy Myco from CI

Browse files
Files changed (1) hide show
  1. game/engine.py +5 -0
game/engine.py CHANGED
@@ -50,6 +50,7 @@ def discover_mushroom(collection: CollectionState, catalog: Sequence[Mushroom] |
50
  return mushroom, current, history
51
 
52
 
 
53
  def myco_reply(message: str | None, history: ChatHistory | None, current: MushroomState | None):
54
  def myco_reply(
55
  message: str | None,
@@ -85,6 +86,7 @@ def myco_reply(message: str, history: ChatHistory, current: MushroomState | None
85
  return "", next_history
86
 
87
 
 
88
  def collect_current(current: MushroomState | None, collection: CollectionState | None, history: ChatHistory | None):
89
  def collect_current(
90
  current: MushroomState | None,
@@ -113,6 +115,7 @@ def collect_current(
113
  ]
114
 
115
 
 
116
  def study_current(current: MushroomState | None, history: ChatHistory | None):
117
  def study_current(
118
  current: MushroomState | None, history: ChatHistory | None
@@ -151,6 +154,7 @@ def study_current(current: MushroomState | None, history: ChatHistory) -> tuple[
151
  return studied, [*current_history, {"role": "assistant", "content": message}]
152
 
153
 
 
154
  def eat_current(current: MushroomState | None, history: ChatHistory | None):
155
  def eat_current(current: MushroomState | None, history: ChatHistory | None) -> ChatHistory:
156
  """Handle the Eat choice safely with Myco's companion personality."""
@@ -212,6 +216,7 @@ def _safe_collection(collection: CollectionState | None) -> CollectionState:
212
  return list(collection or [])
213
 
214
 
 
215
  def _safe_history(history: ChatHistory | None):
216
  def _safe_history(history: ChatHistory | None) -> ChatHistory:
217
  """Return a copy of chat history, tolerating an uninitialized Gradio state."""
 
50
  return mushroom, current, history
51
 
52
 
53
+ def myco_reply(message: str | None, history, current: MushroomState | None):
54
  def myco_reply(message: str | None, history: ChatHistory | None, current: MushroomState | None):
55
  def myco_reply(
56
  message: str | None,
 
86
  return "", next_history
87
 
88
 
89
+ def collect_current(current: MushroomState | None, collection: CollectionState | None, history):
90
  def collect_current(current: MushroomState | None, collection: CollectionState | None, history: ChatHistory | None):
91
  def collect_current(
92
  current: MushroomState | None,
 
115
  ]
116
 
117
 
118
+ def study_current(current: MushroomState | None, history):
119
  def study_current(current: MushroomState | None, history: ChatHistory | None):
120
  def study_current(
121
  current: MushroomState | None, history: ChatHistory | None
 
154
  return studied, [*current_history, {"role": "assistant", "content": message}]
155
 
156
 
157
+ def eat_current(current: MushroomState | None, history):
158
  def eat_current(current: MushroomState | None, history: ChatHistory | None):
159
  def eat_current(current: MushroomState | None, history: ChatHistory | None) -> ChatHistory:
160
  """Handle the Eat choice safely with Myco's companion personality."""
 
216
  return list(collection or [])
217
 
218
 
219
+ def _safe_history(history):
220
  def _safe_history(history: ChatHistory | None):
221
  def _safe_history(history: ChatHistory | None) -> ChatHistory:
222
  """Return a copy of chat history, tolerating an uninitialized Gradio state."""