Skip to content

Commit bb5636b

Browse files
committed
Revert "Update read me"
This reverts commit ccf6324.
1 parent 0d67cf6 commit bb5636b

1 file changed

Lines changed: 10 additions & 57 deletions

File tree

src/game_sdk/hosted_game/README.md

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
This is a Python SDK for the Virtuals Twitter Agent. It allows you to configure and deploy agents that can interact with the Twitter/X platform. This SDK/API allows you to configure your agents powered by the GAME architecture. This is similar to configuring your agent in the [Agent Sandbox](https://game-lite.virtuals.io/) on the [Virtuals Platform](https://app.virtuals.io/).
44

55
## Create an API key
6-
76
Open the [Virtuals Platform](https://app.virtuals.io/) and create/get an API key from the Agent Sandbox by clicking `SDK/API Access`
87

98
![getGAMEApi](./../../../docs/imgs/accesskey.jpg)
109

11-
Store the key in a safe location, like a `.bashrc` or a `.zshrc` file.
10+
Store the key in a safe location, like a `.bashrc` or a `.zshrc` file.
1211

1312
```bash
1413
export VIRTUALS_API_KEY="your_virtuals_api_key"
@@ -17,76 +16,47 @@ export VIRTUALS_API_KEY="your_virtuals_api_key"
1716
Alternatively, you can also use a `.env` file ([`python-dotenv` package](https://github.com/theskumar/python-dotenv) to store and load the key) if you are using the Virtuals Python SDK.
1817

1918
## Usage (GAME)
20-
2119
The Virtuals SDK current main functionalities are to develop and configure agents powered by GAME. Other functionalities to interact with the Virtuals Platform will be supported in the future. This GAME SDK can be used for multiple use cases:
2220

2321
1. Develop, evaluate and update the existing Agent in Twitter environment.
24-
2. Build on other platforms and application using GAME (Task-based Agent).
22+
2. Build on other platforms and application using GAME (Task-based Agent).
2523

2624
### Update the existing Agent in Twitter environment
27-
2825
The SDK provides another interface to configure agents that is more friendly to developers rather than through a UI. This is similar to configuring your agent in the [Agent Sandbox](https://game-lite.virtuals.io/).
2926

3027
```python
3128
from game_sdk.hosted_game.agent import Agent
3229

33-
34-
3530
# Create agent with just strings for each component
36-
> [!NOTE]
37-
> {{replyCount}} is a variable that will be replaced with the number of replies made by the agent. Only applicable for task_description.
38-
3931
agent = Agent(
4032
api_key=VIRTUALS_API_KEY,
4133
goal="Autonomously analyze crypto markets and provide trading insights",
4234
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",
44-
task_description="Process incoming tweet. Ignore if it is boring or unimportant. Total replies made: {{replyCount}}. Ignore if the conversation has gone too long."
35+
world_info="Virtual crypto trading environment where 1 DOGE = 1 DOGE"
4536
)
4637
```
47-
48-
You can also initialize the agent first with just the API key and set the goals, descriptions and world information separately and check the current agent descriptions if needed.
38+
You can also initialize the agent first with just the API key and set the goals, descriptions and world information separately and check the current agent descriptions if needed.
4939

5040
```python
5141
agent = Agent(api_key=VIRTUALS_API_KEY)
5242

53-
# check what is current goal, descriptions, world_info and task_description
43+
# check what is current goal, descriptions and world_info
5444
agent.get_goal()
5545
agent.get_description()
5646
agent.get_world_info()
57-
agent.get_task_description()
5847

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

65-
# check what is current goal, descriptions, world_info and task_description
53+
# check what is current goal, descriptions and world_info
6654
agent.get_goal()
6755
agent.get_description()
6856
agent.get_world_info()
69-
agent.get_task_description()
70-
71-
# Set heartbeat
72-
agent.set_main_heartbeat(15)
73-
agent.set_reaction_heartbeat(5)
74-
75-
# check what is current heartbeat
76-
agent.get_main_heartbeat()
77-
agent.get_reaction_heartbeat()
78-
```
79-
80-
### Worker
81-
82-
You can add a worker to the agent. This is useful if you want to run a function on a specific worker.
83-
84-
```python
85-
agent.add_worker(Worker(name="worker-twitter", description="worker for twitter", environment={"NODE_ENV": "production"}))
8657
```
8758

8859
### Functions
89-
9060
By default, there are no functions enabled when the agent is initialized (i.e. the agent has no actions/functions it can execute). There are a list of available and provided functions for the Twitter/X platform and you can set them.
9161

9262
```python
@@ -97,7 +67,6 @@ agent.use_default_twitter_functions(["wait", "reply_tweet"])
9767
```
9868

9969
You can then equip the agent with some custom functions. Because the agent is hosted, custom functions need to be wrapped in API calls and can then be defined as follows:
100-
10170
```python
10271

10372
search_function = game.Function(
@@ -117,26 +86,19 @@ search_function = game.Function(
11786
success_feedback="I found the best songs",
11887
error_feedback="I couldn't find the best songs",
11988
)
120-
worker= Worker( # you can link a worker to the function
121-
name="worker custom search internet",
122-
description="worker for custom search internet",
123-
environment={"NODE_ENV": "production"}
124-
)
12589
)
12690

12791
# adding custom functions only for platform twitter
12892
agent.add_custom_function(search_function)
12993
```
13094

13195
### Evaluate with Simulate, Deploy
132-
13396
You can simulate one step of the agentic loop on Twitter/X with your new configurations and see the outputs. This is similar to the simulate button on the [Agent Sandbox](https://game-lite.virtuals.io/).
13497

13598
```python
13699
# Simulate one step of the full agentic loop on Twitter/X from the HLP -> LLP -> action (NOTE: supported for Twitter/X only now)
137100
response = agent.simulate_twitter(session_id="123")
138101
```
139-
140102
To more realistically simulate deployment, you can also run through the simulate function with the same session id for a number of steps.
141103

142104
```python
@@ -156,15 +118,13 @@ response = agent.react(
156118
```
157119

158120
Once you are happy, `deploy_twitter` will push your agent configurations to production and run your agent on Twitter/X autonomously.
159-
160121
```python
161122
# deploy agent! (NOTE: supported for Twitter/X only now)
162123
agent.deploy_twitter()
163124
```
164125

165126
## Build on other platforms using GAME
166-
167-
`simulate_twitter` and `deploy_twitter` runs through the entire GAME stack from HLPLLP→ action/function selected. However, these agent functionalities are currently for the Twitter/X platform. You may utilize Task-based Agent with Low-Level Planner and Reaction Module to develop applications that are powered by GAME. The Low Level Planner (LLP) of the agent (please see [documentation](https://www.notion.so/1592d2a429e98016b389ea26b53686a3?pvs=21) for more details on GAME and LLP) can separately act as a decision making engine based on a task description and event occurring. This agentic architecture is simpler but also sufficient for many applications.
127+
`simulate_twitter` and `deploy_twitter` runs through the entire GAME stack from HLP → LLP→ action/function selected. However, these agent functionalities are currently for the Twitter/X platform. You may utilize Task-based Agent with Low-Level Planner and Reaction Module to develop applications that are powered by GAME. The Low Level Planner (LLP) of the agent (please see [documentation](https://www.notion.so/1592d2a429e98016b389ea26b53686a3?pvs=21) for more details on GAME and LLP) can separately act as a decision making engine based on a task description and event occurring. This agentic architecture is simpler but also sufficient for many applications.
168128

169129
We are releasing this simpler setup as a more generalised/platform agnostic framework (not specific to Twitter/X). The entire GAME stack along with the HLP will be opened up to be fully configurable and platform agnostic in the coming weeks.
170130

@@ -190,23 +150,19 @@ response = agent.react(
190150
## Arguments Definition
191151

192152
### Session ID
193-
194-
The session ID is an identifier for an instance of the agent. When using the same session ID, it maintains and picks up from where it last left off, continuing the session/instance. It should be split per user/ conversation that you are maintaining on your platform. For different platforms, different session ID can be used.
153+
The session ID is an identifier for an instance of the agent. When using the same session ID, it maintains and picks up from where it last left off, continuing the session/instance. It should be split per user/ conversation that you are maintaining on your platform. For different platforms, different session ID can be used.
195154

196155
### Platform Tag
197-
198156
When adding custom functions, and when calling the react agent (i.e. LLP), there is a platform tag that can be defined. This acts like a filter for the functions available that is passed to the agent. You should define the platform when passing in the events.
199157

200158
### Task Description
201-
202159
Task description serves as the prompt for the agent to respond. Since the reaction can be platform-based, you can define task description based on the platforms. In the task description, you should pass in any related info that require agent to make decision. That should include:
203-
204160
- User message
205161
- Conversation history
206162
- Instructions
207163

208-
## Importing Functions and Sharing Functions
209164

165+
## Importing Functions and Sharing Functions
210166
With this SDK and function structure, importing and sharing functions is also possible. Looking forward to all the different contributions and functionalities we will build together as a community!
211167

212168
```python
@@ -230,7 +186,4 @@ pin_message_fn("xxxxxxxx", "xx", "True")
230186
agent.add_custom_function(reply_message_fn)
231187
agent.add_custom_function(create_poll_fn)
232188
agent.add_custom_function(pin_message_fn)
233-
234-
# reset memory
235-
agent.reset_memory()
236189
```

0 commit comments

Comments
 (0)