byte-vortex commited on
Commit
4b6bca1
·
verified ·
1 Parent(s): 8dc8f98

Deploy Myco from CI

Browse files
Files changed (1) hide show
  1. game/engine.py +12 -2
game/engine.py CHANGED
@@ -169,8 +169,18 @@ RARITY_CLUES = {
169
  "Legendary": "The whole clearing goes quiet — this mushroom hides part of the Elder Map.",
170
  }
171
 
172
- # Ensure the catalog is sent to the LLM as context
173
- mushroom_context = json.dumps(load_mushrooms())
 
 
 
 
 
 
 
 
 
 
174
  system_prompt = f"You are a guide in a forest. Here are the mushrooms you can find: {mushroom_context}"
175
 
176
  # ---------------------------------------------------------------------------
 
169
  "Legendary": "The whole clearing goes quiet — this mushroom hides part of the Elder Map.",
170
  }
171
 
172
+ # 1. Get the tuple of objects from your function
173
+ mushroom_objects = load_mushrooms()
174
+
175
+ # 2. Convert each object into a dictionary
176
+ # (Assuming your Mushroom class has a .to_dict() method.
177
+ # If it doesn't, you can use vars(m) instead of m.to_dict())
178
+ mushroom_list_of_dicts = [m.to_dict() for m in mushroom_objects]
179
+
180
+ # 3. Now it is safe to dump to JSON
181
+ mushroom_context = json.dumps(mushroom_list_of_dicts)
182
+
183
+ # 4. Now create your prompt
184
  system_prompt = f"You are a guide in a forest. Here are the mushrooms you can find: {mushroom_context}"
185
 
186
  # ---------------------------------------------------------------------------