Skip to content

Commit 69a43c9

Browse files
committed
make sure all is_global is false and observation defaults to none
1 parent 9b4b837 commit 69a43c9

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

src/game_sdk/game/agent.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ def __init__(self,
142142
self.agent_state = self.get_agent_state_fn(None, None)
143143

144144
# initialize observation
145-
observation_content = self.agent_state["observations"] if "observations" in self.agent_state else ""
146-
self.observation = {
147-
"content": observation_content,
148-
"is_global": True,
149-
}
145+
self.observation = None
150146

151147
# create agent
152148
self.agent_id = self.client.create_agent(
@@ -313,13 +309,13 @@ def step(self):
313309
self.agent_state = self.get_agent_state_fn(
314310
self._session.function_result, self.agent_state)
315311

316-
# update observation (saved state)
312+
# update observation (saved state) - no interruptions (is_global should always be False)
317313
if update_observation == "task":
318314
if "observations" in self.agent_state:
319315
observation_content = self.agent_state["observations"]
320316
self.observation = {
321317
"content": observation_content,
322-
"is_global": True,
318+
"is_global": False,
323319
}
324320
else:
325321
self.observation = None
@@ -332,15 +328,9 @@ def step(self):
332328
"is_global": False,
333329
}
334330
else:
335-
self.observation = {
336-
"content": "",
337-
"is_global": True
338-
}
331+
self.observation = None
339332
else:
340-
self.observation = {
341-
"content": "",
342-
"is_global": True
343-
}
333+
self.observation = None
344334

345335
return action_response, self._session.function_result
346336

0 commit comments

Comments
 (0)