Skip to content

Commit 140279b

Browse files
committed
adjsut read me
1 parent 0232f97 commit 140279b

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

src/game_sdk/hosted_game/README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
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+
67
Open the [Virtuals Platform](https://app.virtuals.io/) and create/get an API key from the Agent Sandbox by clicking `SDK/API Access`
78

89
![getGAMEApi](./../../../docs/imgs/accesskey.jpg)
910

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

1213
```bash
1314
export VIRTUALS_API_KEY="your_virtuals_api_key"
@@ -16,12 +17,14 @@ export VIRTUALS_API_KEY="your_virtuals_api_key"
1617
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.
1718

1819
## Usage (GAME)
20+
1921
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:
2022

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

2426
### Update the existing Agent in Twitter environment
27+
2528
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/).
2629

2730
```python
@@ -35,7 +38,8 @@ agent = Agent(
3538
world_info="Virtual crypto trading environment where 1 DOGE = 1 DOGE"
3639
)
3740
```
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.
41+
42+
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.
3943

4044
```python
4145
agent = Agent(api_key=VIRTUALS_API_KEY)
@@ -54,9 +58,15 @@ agent.set_world_info("Virtual crypto trading environment where 1 DOGE = 1 DOGE")
5458
agent.get_goal()
5559
agent.get_description()
5660
agent.get_world_info()
61+
62+
# set game engine model
63+
# Available models: llama_3_1_405b, deepseek_r1, llama_3_3_70b_instruct, qwen2p5_72b_instruct, deepseek_v3
64+
agent.set_game_engine_model("llama_3_1_405b")
65+
5766
```
5867

5968
### Functions
69+
6070
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.
6171

6272
```python
@@ -67,6 +77,7 @@ agent.use_default_twitter_functions(["wait", "reply_tweet"])
6777
```
6878

6979
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:
80+
7081
```python
7182

7283
search_function = game.Function(
@@ -93,12 +104,14 @@ agent.add_custom_function(search_function)
93104
```
94105

95106
### Evaluate with Simulate, Deploy
107+
96108
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/).
97109

98110
```python
99111
# Simulate one step of the full agentic loop on Twitter/X from the HLP -> LLP -> action (NOTE: supported for Twitter/X only now)
100112
response = agent.simulate_twitter(session_id="123")
101113
```
114+
102115
To more realistically simulate deployment, you can also run through the simulate function with the same session id for a number of steps.
103116

104117
```python
@@ -118,13 +131,15 @@ response = agent.react(
118131
```
119132

120133
Once you are happy, `deploy_twitter` will push your agent configurations to production and run your agent on Twitter/X autonomously.
134+
121135
```python
122136
# deploy agent! (NOTE: supported for Twitter/X only now)
123137
agent.deploy_twitter()
124138
```
125139

126140
## Build on other platforms using GAME
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.
141+
142+
`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.
128143

129144
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.
130145

@@ -150,19 +165,23 @@ response = agent.react(
150165
## Arguments Definition
151166

152167
### Session ID
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.
168+
169+
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.
154170

155171
### Platform Tag
172+
156173
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.
157174

158175
### Task Description
176+
159177
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:
178+
160179
- User message
161180
- Conversation history
162181
- Instructions
163182

164-
165183
## Importing Functions and Sharing Functions
184+
166185
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!
167186

168187
```python

0 commit comments

Comments
 (0)