GAME Python SDK 库 GAME Python SDK 是一款库,可让您与基于 GAME 架构的代理进行交互和开发。通过 GAME 代理 SDK,您可以在游戏中添加代理,并使用代理来实现各种功能。
GAME Python SDK 库 GAME Python SDK 是一款库,可让您与基于 GAME 架构的代理进行交互和开发。通过 GAME 代理 SDK,您可以在游戏中添加代理,并使用代理来实现各种功能。
The GAME Python SDK is a library that allows you interact and develop agents powered by the GAME architecture.
There are 2 main folders in the source code (src folder)
game:
Please refer to test_agent.py and test_worker.py for usage examples.
hosted_game
This is a more abstracted version of the SDK which allows one to deploy a Twitter agent, which would then be hosted by GAME infrastructure.
Note that this README focuses on the code in the game folder. More details about hosted_game can be found in src/hosted_game/README.md.
pip install game_sdkTo get the latest version of the SDK, clone the repository and install from source:
git clone https://github.com/game-by-virtuals/game-python.git
cd game-python
pip install -e .To install the latest versions of the plugins, navigate to the plugin folder to run the installation, e.g.:
cd plugins/twitter
pip install -e .The foundation models which power the GAME framework can also be confgiured and selected. This can be specified when creating agents or workers. The default model used is "Llama-3.1-405B-Instruct".
The models currently supported are:
**Note: If model is not specified in the API call (REST API level) or on the SDK level when creating the agents, the default (Llama-3.1-405B-Instruct) model will be used.
game:
Request for a GAME API key in the Game Console https://console.game.virtuals.io/
Store the key in a safe location, like a .bashrc or a .zshrc file.
export GAME_API_KEY="your_game_api_key"Refer to src/game/README.md for usage guidelines, and refer to test_agent.py and test_worker.py for usage examples.
hosted_game
Open the Virtuals Platform and create/get an API key from the Agent Sandbox by clicking SDK/API Access
Store the key in a safe location, like a .bashrc or a .zshrc file.
export VIRTUALS_API_KEY="your_virtuals_api_key"Refer to src/hosted_game/README.md for usage examples.
If you have any trouble, contact Virtuals support or DevRel team members via Discord or Telegram
Example 1: test_agent.py
python examples/game/test_agent.py Example 2: test_worker.py
python examples/game/test_worker.py Example 3: example_twitter_reaction_module.py
python examples/game/example_twitter_reaction_module.py Example 1: example-custom.py
python examples/hosted_agent/example-custom.py Example 2: example-twitter.py
python examples/hosted_agent/example-twitter.pyGAME is a modular agentic framework which enables an agent to plan actions and make decisions autonomously based on information provided to it.
Please refer to our whitepaper for more information and resources.
Currently, the SDK (specifically the code in the game folder) allows you to develop your agents powered by the GAME architecture in its most fullest and most flexible form.
The python SDK is made up of 3 main components (Agent, Worker, function), each with configurable arguments.
Agent (a.k.a. high level planner)
Worker (a.k.a. low-level planner
Function
ℹ️ Differences from the hosted GAME SDK version (i.e.
hosted_game)
- Ability to fully customise functions (previously, each function was a single API call)
- Ability to control the low-level planner via description prompt (previously, only the high-level planner and functions could be controlled via description prompts)
- The description defined in the agent is equivalent to what was previously known as world information and agent description
Want to help improve the project? Please see our detailed Contribution Guide.
Detailed documentation to better understand the configurable components and the GAME architecture can be found on here.
暂无开放 Issues,或尚未同步最近议题。