Skip to main content

Official Python SDK for GAME by Virtuals

Project description

GAME Python SDK Library

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)

  1. game:

    Please refer to test_agent.py and test_worker.py for usage examples.

  2. 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.

Installation

pip install game_sdk

To 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 .

Usage

  1. game:

  2. hosted_game

    • Open the Virtuals Platform and create/get an API key from the Agent Sandbox by clicking SDK/API Access getGAMEApi

    • 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

About G.A.M.E.

GAME 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.

About GAME Python SDK

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.

New SDK visual The python SDK is made up of 3 main components (Agent, Worker, function), each with configurable arguments.

Agent (a.k.a. high level planner)

  • Takes in a Goal
    • Drives the agents behaviour through the high level plan which influences the thinking and creation of tasks that would contribute towards this goal
  • Takes in a Description
    • Combination of what was previously known as World Info + Agent Description
    • This include a description of the "world" the agent lives in, and the personality and background of the agent

Worker (a.k.a. low-level planner)

  • Takes in a Description
    • Used to control which workers are called by the agent, based on the high-level plan and tasks created to contribute to the goal

Function

  • Takes in a Description
    • Used to control which functions are called by the workers, based on each worker's low-level plan
    • This can be any python executable

Features

  • Develop your own custom agents for any application or platform.
  • Ability to control your agents and workers via descriptions (prompts)
  • Full control of what the agent sees (state) and can do (actions/functions)
  • Ability to fully customise functions. This could include various combinations of programmed logic. For example:
    • Calling an API to retrieve data
    • Calling an API to retrieve data, followed by custom calculations or data processing logic in python code
    • 2 API calls chained together (e.g. calling an API to retrieve web data, and then posting a tweet)

ℹ️ Differences from the hosted GAME SDK version (i.e. hosted_game)

Old SDK visual

  • 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

How to Contribute

Want to help improve the project? Please see our detailed Contribution Guide.

Documentation

Detailed documentation to better understand the configurable components and the GAME architecture can be found on here.

Useful Resources

  • GAME TypeScript SDK: The core logic of this SDK mirrors the logic of this python SDK if you prefer to develop your agents in TypeScript. Typescript SDK repository and contributed typescript plugins can be found here.
  • Hosted GAME Agent: This SDK also enables configuration and deployment of an out-of-the-box hosted agent that can be used to interact with the Twitter/X platform, powered by GAME. This agent comes with existing functions/actions that can be used to interact with the Twitter/X platform and can be immediately hosted/deployed as you configure it. This is similar to configuring your agent in the Agent Sandbox on the Virtuals Platform but through a developer-friendly SDK interface.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

game_sdk-0.1.3.tar.gz (411.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

game_sdk-0.1.3-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file game_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: game_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 411.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.2

File hashes

Hashes for game_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3689ae9a9b7c457378064ab1c919c7ec08a7448c9fa15eb2090d15c433451a64
MD5 d5bc09fedab96062ce1692be7870522c
BLAKE2b-256 072f6d63c5d3f398790a58896a594a88716a66a04d20c0c30191638f91720729

See more details on using hashes here.

File details

Details for the file game_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: game_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.2

File hashes

Hashes for game_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 71fead79032f0e00c63910329304e0bb0a7db59cab6bae93deef3e6eba3e1e65
MD5 df601409ddf94cdd7d02394af8b4ee64
BLAKE2b-256 3671d6fe37738d568d5b15facac9b572e7a2b4eb3eab0af074e81f1e891edf53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page