Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions examples/hosted_agent/example-twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
api_key=os.environ.get("VIRTUALS_API_KEY"),
goal="search for best songs",
description="Test Description",
world_info="Test World Info",
task_description="reply to tweet that worth your attention, if not ignore"
)

Expand Down Expand Up @@ -49,9 +48,6 @@
Character goal:
{{twitterGoal}}
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.
{{worldInfo}}
{{retrieveKnowledge}}
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.
Expand Down
8 changes: 2 additions & 6 deletions src/game_sdk/hosted_game/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ agent = Agent(
api_key=VIRTUALS_API_KEY,
goal="Autonomously analyze crypto markets and provide trading insights",
description="HODL-9000: A meme-loving trading bot powered by hopium and ramen",
world_info="Virtual crypto trading environment where 1 DOGE = 1 DOGE",
task_description="Process incoming tweet. Ignore if it is boring or unimportant. Total replies made: {{replyCount}}. Ignore if the conversation has gone too long."
)
```
Expand All @@ -50,22 +49,19 @@ You can also initialize the agent first with just the API key and set the goals,
```python
agent = Agent(api_key=VIRTUALS_API_KEY)

# check what is current goal, descriptions, world_info and task_description
# check what is current goal, descriptions and task_description
agent.get_goal()
agent.get_description()
agent.get_world_info()
agent.get_task_description()

# Set components individually - set change the agent goal/description/worldinfo/task_description
agent.set_goal("Autonomously analyze crypto markets and provide trading insights")
agent.set_description("HODL-9000: A meme-loving trading bot powered by hopium and ramen")
agent.set_world_info("Virtual crypto trading environment where 1 DOGE = 1 DOGE")
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.")

# check what is current goal, descriptions, world_info and task_description
# check what is current goal, descriptions and task_description
agent.get_goal()
agent.get_description()
agent.get_world_info()
agent.get_task_description()

# set game engine model
Expand Down
13 changes: 0 additions & 13 deletions src/game_sdk/hosted_game/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def __init__(
api_key: str,
goal: str = "",
description: str = "",
world_info: str = "",
main_heartbeat: int = 15,
reaction_heartbeat: int = 5,
task_description: str = "",
Expand All @@ -260,7 +259,6 @@ def __init__(
self.game_sdk = sdk.GameSDK(api_key)
self.goal = goal
self.description = description
self.world_info = world_info
self.enabled_functions: List[str] = []
self.custom_functions: List[Function] = []
self.main_heartbeat = main_heartbeat
Expand All @@ -278,10 +276,6 @@ def set_description(self, description: str):
self.description = description
return True

def set_world_info(self, world_info: str):
self.world_info = world_info
return True

def set_main_heartbeat(self, main_heartbeat: int):
self.main_heartbeat = main_heartbeat
return True
Expand Down Expand Up @@ -311,9 +305,6 @@ def get_goal(self) -> str:
def get_description(self) -> str:
return self.description

def get_world_info(self) -> str:
return self.world_info

def list_available_default_twitter_functions(self) -> Dict[str, str]:
"""
List all of the default functions (currently default functions are only available for Twitter/X platform)
Expand Down Expand Up @@ -347,7 +338,6 @@ def simulate_twitter(self, session_id: str):
session_id,
self.goal,
self.description,
self.world_info,
self.enabled_functions,
self.custom_functions
)
Expand All @@ -366,7 +356,6 @@ def react(self, session_id: str, platform: str, tweet_id: str = None, event: str
tweet_id=tweet_id,
goal=self.goal,
description=self.description,
world_info=self.world_info,
functions=self.enabled_functions,
custom_functions=self.custom_functions
)
Expand All @@ -378,7 +367,6 @@ def deploy_twitter(self):
return self.game_sdk.deploy(
self.goal,
self.description,
self.world_info,
self.enabled_functions,
self.custom_functions,
self.main_heartbeat,
Expand All @@ -393,7 +381,6 @@ def export(self) -> str:
export_dict = {
"goal": self.goal,
"description": self.description,
"worldInfo": self.world_info,
"functions": self.enabled_functions,
"customFunctions": [
{
Expand Down
9 changes: 3 additions & 6 deletions src/game_sdk/hosted_game/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def functions(self):

return functions

def simulate(self, session_id: str, goal: str, description: str, world_info: str, functions: list, custom_functions: list):
def simulate(self, session_id: str, goal: str, description: str, functions: list, custom_functions: list):
"""
Simulate the agent configuration
"""
Expand All @@ -36,7 +36,6 @@ def simulate(self, session_id: str, goal: str, description: str, world_info: st
"sessionId": session_id,
"goal": goal,
"description": description,
"worldInfo": world_info,
"functions": functions,
"customFunctions": [x.toJson() for x in custom_functions]
}
Expand All @@ -50,7 +49,7 @@ def simulate(self, session_id: str, goal: str, description: str, world_info: st
return response.json()["data"]

def react(self, session_id: str, platform: str, goal: str,
description: str, world_info: str, functions: list, custom_functions: list,
description: str, functions: list, custom_functions: list,
event: str = None, task: str = None, tweet_id: str = None):
"""
Simulate the agent configuration
Expand All @@ -61,7 +60,6 @@ def react(self, session_id: str, platform: str, goal: str,
"sessionId": session_id,
"goal": goal,
"description": description,
"worldInfo": world_info,
"functions": functions,
"customFunctions": [x.toJson() for x in custom_functions]
}
Expand Down Expand Up @@ -90,14 +88,13 @@ def react(self, session_id: str, platform: str, goal: str,

return response.json()["data"]

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"):
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"):
"""
Simulate the agent configuration
"""
payload = {
"goal": goal,
"description": description,
"worldInfo": world_info,
"functions": functions,
"customFunctions": [x.toJson() for x in custom_functions],
"gameState": {
Expand Down