Skip to content

Commit a30c980

Browse files
authored
Merge pull request #62 from stevensf1998/feat/allow-reset-memory
Allow to reset memory for GAME production
2 parents 1d5037f + b890cee commit a30c980

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

examples/hosted_agent/example-twitter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,6 @@
109109

110110
# running simulation module only for platform twitter
111111
agent.simulate_twitter(session_id="session-twitter")
112+
113+
# reset production memory
114+
#agent.reset_memory()

src/game_sdk/hosted_game/agent.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,3 +442,6 @@ def add_share_template(
442442
))
443443

444444
return True
445+
446+
def reset_memory(self):
447+
return self.game_sdk.reset_memory()

src/game_sdk/hosted_game/sdk.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,12 @@ def deploy(self, goal: str, description: str, world_info: str, functions: list,
126126
raise Exception(response.json())
127127

128128
return response.json()["data"]
129+
130+
def reset_memory(self):
131+
response = requests.get(
132+
f"{self.api_url}/reset-session", headers={"x-api-key": self.api_key})
133+
134+
if (response.status_code != 200):
135+
raise Exception("Failed to reset memory.")
136+
137+
return "Memory reset successfully."

0 commit comments

Comments
 (0)