Skip to content

Commit f6c548d

Browse files
authored
Merge pull request game-by-virtuals#85 from stevensf1998/feat/remove-world-info
remove world info
2 parents fa05435 + 7acc1ce commit f6c548d

File tree

4 files changed

+5
-29
lines changed

4 files changed

+5
-29
lines changed

examples/hosted_agent/example-twitter.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
api_key=os.environ.get("VIRTUALS_API_KEY"),
66
goal="search for best songs",
77
description="Test Description",
8-
world_info="Test World Info",
98
task_description="reply to tweet that worth your attention, if not ignore"
109
)
1110

@@ -49,9 +48,6 @@
4948
Character goal:
5049
{{twitterGoal}}
5150
52-
These are the world info that might be useful as additional context for your response. You do not need to use any of the information describe in this section if you don't need it.
53-
{{worldInfo}}
54-
5551
{{retrieveKnowledge}}
5652
5753
This your post history, you should evaluate if it is repetitive or aligned with your goal. Post history is sorted by oldest to newest. Be creative.

src/game_sdk/hosted_game/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ agent = Agent(
4040
api_key=VIRTUALS_API_KEY,
4141
goal="Autonomously analyze crypto markets and provide trading insights",
4242
description="HODL-9000: A meme-loving trading bot powered by hopium and ramen",
43-
world_info="Virtual crypto trading environment where 1 DOGE = 1 DOGE",
4443
task_description="Process incoming tweet. Ignore if it is boring or unimportant. Total replies made: {{replyCount}}. Ignore if the conversation has gone too long."
4544
)
4645
```
@@ -50,22 +49,19 @@ You can also initialize the agent first with just the API key and set the goals,
5049
```python
5150
agent = Agent(api_key=VIRTUALS_API_KEY)
5251

53-
# check what is current goal, descriptions, world_info and task_description
52+
# check what is current goal, descriptions and task_description
5453
agent.get_goal()
5554
agent.get_description()
56-
agent.get_world_info()
5755
agent.get_task_description()
5856

5957
# Set components individually - set change the agent goal/description/worldinfo/task_description
6058
agent.set_goal("Autonomously analyze crypto markets and provide trading insights")
6159
agent.set_description("HODL-9000: A meme-loving trading bot powered by hopium and ramen")
62-
agent.set_world_info("Virtual crypto trading environment where 1 DOGE = 1 DOGE")
6360
agent.set_task_description("Process incoming tweet. Ignore if it is boring or unimportant. Total replies made: {{replyCount}}. Ignore if the conversation has gone too long.")
6461

65-
# check what is current goal, descriptions, world_info and task_description
62+
# check what is current goal, descriptions and task_description
6663
agent.get_goal()
6764
agent.get_description()
68-
agent.get_world_info()
6965
agent.get_task_description()
7066

7167
# set game engine model

src/game_sdk/hosted_game/agent.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ def __init__(
251251
api_key: str,
252252
goal: str = "",
253253
description: str = "",
254-
world_info: str = "",
255254
main_heartbeat: int = 15,
256255
reaction_heartbeat: int = 5,
257256
task_description: str = "",
@@ -260,7 +259,6 @@ def __init__(
260259
self.game_sdk = sdk.GameSDK(api_key)
261260
self.goal = goal
262261
self.description = description
263-
self.world_info = world_info
264262
self.enabled_functions: List[str] = []
265263
self.custom_functions: List[Function] = []
266264
self.main_heartbeat = main_heartbeat
@@ -278,10 +276,6 @@ def set_description(self, description: str):
278276
self.description = description
279277
return True
280278

281-
def set_world_info(self, world_info: str):
282-
self.world_info = world_info
283-
return True
284-
285279
def set_main_heartbeat(self, main_heartbeat: int):
286280
self.main_heartbeat = main_heartbeat
287281
return True
@@ -311,9 +305,6 @@ def get_goal(self) -> str:
311305
def get_description(self) -> str:
312306
return self.description
313307

314-
def get_world_info(self) -> str:
315-
return self.world_info
316-
317308
def list_available_default_twitter_functions(self) -> Dict[str, str]:
318309
"""
319310
List all of the default functions (currently default functions are only available for Twitter/X platform)
@@ -347,7 +338,6 @@ def simulate_twitter(self, session_id: str):
347338
session_id,
348339
self.goal,
349340
self.description,
350-
self.world_info,
351341
self.enabled_functions,
352342
self.custom_functions
353343
)
@@ -366,7 +356,6 @@ def react(self, session_id: str, platform: str, tweet_id: str = None, event: str
366356
tweet_id=tweet_id,
367357
goal=self.goal,
368358
description=self.description,
369-
world_info=self.world_info,
370359
functions=self.enabled_functions,
371360
custom_functions=self.custom_functions
372361
)
@@ -378,7 +367,6 @@ def deploy_twitter(self):
378367
return self.game_sdk.deploy(
379368
self.goal,
380369
self.description,
381-
self.world_info,
382370
self.enabled_functions,
383371
self.custom_functions,
384372
self.main_heartbeat,
@@ -393,7 +381,6 @@ def export(self) -> str:
393381
export_dict = {
394382
"goal": self.goal,
395383
"description": self.description,
396-
"worldInfo": self.world_info,
397384
"functions": self.enabled_functions,
398385
"customFunctions": [
399386
{

src/game_sdk/hosted_game/sdk.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def functions(self):
2525

2626
return functions
2727

28-
def simulate(self, session_id: str, goal: str, description: str, world_info: str, functions: list, custom_functions: list):
28+
def simulate(self, session_id: str, goal: str, description: str, functions: list, custom_functions: list):
2929
"""
3030
Simulate the agent configuration
3131
"""
@@ -36,7 +36,6 @@ def simulate(self, session_id: str, goal: str, description: str, world_info: st
3636
"sessionId": session_id,
3737
"goal": goal,
3838
"description": description,
39-
"worldInfo": world_info,
4039
"functions": functions,
4140
"customFunctions": [x.toJson() for x in custom_functions]
4241
}
@@ -50,7 +49,7 @@ def simulate(self, session_id: str, goal: str, description: str, world_info: st
5049
return response.json()["data"]
5150

5251
def react(self, session_id: str, platform: str, goal: str,
53-
description: str, world_info: str, functions: list, custom_functions: list,
52+
description: str, functions: list, custom_functions: list,
5453
event: str = None, task: str = None, tweet_id: str = None):
5554
"""
5655
Simulate the agent configuration
@@ -61,7 +60,6 @@ def react(self, session_id: str, platform: str, goal: str,
6160
"sessionId": session_id,
6261
"goal": goal,
6362
"description": description,
64-
"worldInfo": world_info,
6563
"functions": functions,
6664
"customFunctions": [x.toJson() for x in custom_functions]
6765
}
@@ -90,14 +88,13 @@ def react(self, session_id: str, platform: str, goal: str,
9088

9189
return response.json()["data"]
9290

93-
def deploy(self, goal: str, description: str, world_info: str, functions: list, custom_functions: list, main_heartbeat: int, reaction_heartbeat: int, tweet_usernames: list = None, templates: list = None, game_engine_model: str = "llama_3_1_405b"):
91+
def deploy(self, goal: str, description: str, functions: list, custom_functions: list, main_heartbeat: int, reaction_heartbeat: int, tweet_usernames: list = None, templates: list = None, game_engine_model: str = "llama_3_1_405b"):
9492
"""
9593
Simulate the agent configuration
9694
"""
9795
payload = {
9896
"goal": goal,
9997
"description": description,
100-
"worldInfo": world_info,
10198
"functions": functions,
10299
"customFunctions": [x.toJson() for x in custom_functions],
103100
"gameState": {

0 commit comments

Comments
 (0)