Spaces:
Runtime error
Runtime error
update
Browse files- gradio_backend.py +4 -2
gradio_backend.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import os
|
2 |
import argparse
|
3 |
import sys
|
|
|
|
|
4 |
from agents.utils import extract
|
5 |
from agents.SOP import SOP
|
6 |
from agents.Agent import Agent
|
@@ -94,7 +96,7 @@ def prepare(agents, sop, environment):
|
|
94 |
client = Client()
|
95 |
Client.send_server = client.send_message
|
96 |
|
97 |
-
requirement_game_name = extract(sop.states['design_state'].environment_prompt,"
|
98 |
client.send_message(
|
99 |
{
|
100 |
"requirement": requirement_game_name,
|
@@ -109,7 +111,7 @@ def prepare(agents, sop, environment):
|
|
109 |
client.mode = Client.mode = client.cache["mode"]
|
110 |
new_requirement = Client.cache['requirement']
|
111 |
for state in sop.states.values():
|
112 |
-
state.environment_prompt = state.environment_prompt.replace("<
|
113 |
# print(f"client: received {Client.cache['requirement']} from server.")
|
114 |
|
115 |
if __name__ == '__main__':
|
|
|
1 |
import os
|
2 |
import argparse
|
3 |
import sys
|
4 |
+
sys.path.append("../../../src/agents")
|
5 |
+
sys.path.append("../../Gradio_Config")
|
6 |
from agents.utils import extract
|
7 |
from agents.SOP import SOP
|
8 |
from agents.Agent import Agent
|
|
|
96 |
client = Client()
|
97 |
Client.send_server = client.send_message
|
98 |
|
99 |
+
requirement_game_name = extract(sop.states['design_state'].environment_prompt,"target")
|
100 |
client.send_message(
|
101 |
{
|
102 |
"requirement": requirement_game_name,
|
|
|
111 |
client.mode = Client.mode = client.cache["mode"]
|
112 |
new_requirement = Client.cache['requirement']
|
113 |
for state in sop.states.values():
|
114 |
+
state.environment_prompt = state.environment_prompt.replace("<target>a snake game with python</target>", f"<target>{new_requirement}</target>")
|
115 |
# print(f"client: received {Client.cache['requirement']} from server.")
|
116 |
|
117 |
if __name__ == '__main__':
|