Skip to main content

Local API Client

A lightweight Python client designed to easily interact with Player2 Local Endpoints.

Installation

Install the package via pip:

pip install player2

Usage

1. Initialize the Client

When initializing the client, pass your game_id. It will automatically handle web login to fetch authorization keys and spin up a background health-check loop.

from player2 import APIClient

client = APIClient(game_id="your_game_id")  # Get the gameID from the player2 website

2. Chat Completions

Send user queries with optional system instructions:

response = client.chat(
    user="Hello, how are you doing today?",
    system="You are a helpful and witty assistant."
)

print(response)

3. Text-to-Speech (TTS)

Trigger speech generation locally:

tts_response = client.speak(
    text="Hello, how are you doing today?",
    instructions="Speak with a cheerful tone",
    speed=1.0
)

print(tts_response)

Metadata

Release files for player2 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for player2 0.0.1
File Size Uploaded Provenance
player2-0.0.1.tar.gz 3.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for player2 0.0.1
File Interpreter ABI Platform
player2-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / player2-0.0.1.tar.gz

Download URL player2-0.0.1.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a86559a3114cb1efd2ebd14e16aab6801a109ceeb5e4a99497fb419e84599e30
BLAKE2b-256 checksum
How to use checksums
3158d0cad5123da080ea0a84c4c9248a1c9ed127578985ca947ecf133c7c7121
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / player2-0.0.1-py3-none-any.whl

Download URL player2-0.0.1-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f759369f64fe5fd3a9495460fc2954d774582da553ab2a67f86139fe116516b
BLAKE2b-256 checksum
How to use checksums
29959b64c0471ac3d6065ada71ff87e53f33ce3e4085ab7f6b31de3d609a3b5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for player2 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page