Metadata-Version: 2.4
Name: player2
Version: 0.0.1
Summary: A lightweight client for Player2
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests

# Local API Client

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

## Installation

Install the package via pip:

```bash
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.

```python
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:

```python
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:

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

print(tts_response)
```
