Metadata-Version: 2.4
Name: ojin-client
Version: 0.1.7.dev12
Summary: Ojin platform services
Author: Journee
License: Apache-2.0
Project-URL: Homepage, https://github.com/journee-live/ojin
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: websockets>=14.0
Requires-Dist: async-lru>=2.0.5
Requires-Dist: pyjwt>=2.10.1
Requires-Dist: pydantic-settings>=2.8.1
Provides-Extra: dev
Requires-Dist: pytest>=8.3.5; extra == "dev"
Requires-Dist: pytest-asyncio>=0.26.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-httpx>=0.35.0; extra == "dev"
Requires-Dist: ruff>=0.11.4; extra == "dev"
Requires-Dist: build>=0.10.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Requires-Dist: fastapi>=0.115.13; extra == "dev"
Requires-Dist: uvicorn>=0.34.3; extra == "dev"

# Ojin Persona Client

A WebSocket client for Ojin Avatar model that handles communication with Inference Server. It is used for example by Ojin Persona Service for Pipecat https://github.com/pipecat-ai/pipecat

## Requirements

- Python 3.10+
- pip or uv package manager

## Installation

```bash
pip install ojin-client
```

### Usage

```python
from ojin.ojin_avatar_client import OjinAvatarClient

avatar = OjinAvatarClient(
        ws_url="THE_OJIN_URL",
        api_key="YOUR_OJIN_API_KEY",
        avatar_config_id="YOUR_OJIN_CONFIGURATION"M
    )
```

### API methods

- connect: Establishes the websocket connection with the ojin inference server
- send_message: Sends messages to the ojin inference server
- receive_message: Receives messages from the ojin inference server
- close: closes the connection with ojin inference server

### Messages

- OjinAvatarInteractionReadyMessage: Message indicating that an interaction is ready to begin

- OjinAvatarSessionReadyMessage: Message to start a new interaction with an Ojin Avatar

- OjinAvatarCancelInteractionMessage: Message to cancel an interaction

- OjinAvatarInteractionInputMessage: Contains the audio data as bytes and a flag indicating if this is the last input

### Responses

- StartInteractionResponseMessage: Response message for a successful interaction start

- OjinAvatarInteractionResponseMessage: Response message containing video data from the avatar

- ErrorResponseMessage: Response message informing the client there was an error
