Spaces:
Sleeping
Sleeping
Deploy Myco from CI
Browse files- game/engine.py +3 -11
game/engine.py
CHANGED
|
@@ -1,14 +1,3 @@
|
|
| 1 |
-
import json
|
| 2 |
-
from pathlib import Path # This MUST come before you use Path()
|
| 3 |
-
from functools import lru_cache
|
| 4 |
-
|
| 5 |
-
# Now it is safe to use Path
|
| 6 |
-
CATALOG_PATH = Path(__file__).resolve().parents[1] / "data" / "mushrooms.json"
|
| 7 |
-
|
| 8 |
-
# Now you can add your debug prints
|
| 9 |
-
print(f"DEBUG: Looking for file at: {CATALOG_PATH}")
|
| 10 |
-
print(f"DEBUG: Does the file exist? {CATALOG_PATH.exists()}")
|
| 11 |
-
|
| 12 |
"""
|
| 13 |
Core Myco gameplay — LLM is the primary game engine.
|
| 14 |
"""
|
|
@@ -180,6 +169,9 @@ RARITY_CLUES = {
|
|
| 180 |
"Legendary": "The whole clearing goes quiet — this mushroom hides part of the Elder Map.",
|
| 181 |
}
|
| 182 |
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
# ---------------------------------------------------------------------------
|
| 185 |
# Utility: extract JSON or return text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""
|
| 2 |
Core Myco gameplay — LLM is the primary game engine.
|
| 3 |
"""
|
|
|
|
| 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 |
# ---------------------------------------------------------------------------
|
| 177 |
# Utility: extract JSON or return text
|