Spaces:
Sleeping
Sleeping
Build MCP server
Browse files- app.py +15 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -60,7 +60,20 @@ class WordleEnv:
|
|
60 |
return self._obs
|
61 |
|
62 |
|
63 |
-
def step_fn(guess: str, wordle) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
result = wordle.step(guess)
|
65 |
return result.observation, result.reward, result.done, result.info, wordle
|
66 |
|
@@ -79,4 +92,4 @@ demo = gr.Interface(
|
|
79 |
|
80 |
|
81 |
if __name__ == "__main__":
|
82 |
-
demo.launch()
|
|
|
60 |
return self._obs
|
61 |
|
62 |
|
63 |
+
def step_fn(guess: str, wordle) -> tuple[str, float, bool, dict]:
|
64 |
+
"""
|
65 |
+
Perform a step in the Wordle environment.
|
66 |
+
|
67 |
+
Args:
|
68 |
+
guess (str): The guessed word (4-letter lowercase string).
|
69 |
+
|
70 |
+
Returns:
|
71 |
+
tuple[str, float, bool, dict]: A tuple containing:
|
72 |
+
- observation: The observation after the step .
|
73 |
+
- reward: The reward obtained from the step.
|
74 |
+
- done: Whether the game is done.
|
75 |
+
- info: Additional info.
|
76 |
+
"""
|
77 |
result = wordle.step(guess)
|
78 |
return result.observation, result.reward, result.done, result.info, wordle
|
79 |
|
|
|
92 |
|
93 |
|
94 |
if __name__ == "__main__":
|
95 |
+
demo.launch(mcp_server=True)
|
requirements.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
gradio==5.46.0 # Set in README.md
|
|
|
1 |
+
gradio[mcp]==5.46.0 # Set in README.md
|