Skip to main content

Ojin platform services

Project description

Ojin Persona Client

A WebSocket client for Ojin Persona 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

pip install ojin-client

Usage

from ojin.ojin_persona_client import OjinPersonaClient

avatar = OjinPersonaClient(
        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
  • start_interaction: Creates a UUID to send in the interaction messages
  • 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

  • OjinPersonaInteractionReadyMessage: Message indicating that an interaction is ready to begin

  • OjinPersonaSessionReadyMessage: Message to start a new interaction with an Ojin Persona

  • OjinPersonaCancelInteractionMessage: Message to cancel an interaction

  • OjinPersonaInteractionInputMessage: 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

  • OjinPersonaInteractionResponseMessage: Response message containing video data from the avatar

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

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

ojin_client-0.2.4.tar.gz (140.0 kB view details)

Uploaded Source

Built Distribution

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

ojin_client-0.2.4-py3-none-any.whl (140.5 kB view details)

Uploaded Python 3

File details

Details for the file ojin_client-0.2.4.tar.gz.

File metadata

  • Download URL: ojin_client-0.2.4.tar.gz
  • Upload date:
  • Size: 140.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for ojin_client-0.2.4.tar.gz
Algorithm Hash digest
SHA256 8ec4451e31bea30b0c65a98ec3b684b61b4bfde92d2819f4b914c4f00b5ea374
MD5 8cd4fa72c746fc7ef803c5535a4dd6e6
BLAKE2b-256 afe9253f4e1ca8c600d4f727c88f09f60e9faefb7b1c27f401eac1fb6c60b4dd

See more details on using hashes here.

File details

Details for the file ojin_client-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: ojin_client-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 140.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for ojin_client-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 dccbcf41deefa03fac83300fb0d7e9dce2ce9be30e7e1291e21a0c1a9122251b
MD5 43ea5139733e415c33367575b256ea35
BLAKE2b-256 b74afa0bfb92b68396364164fa9aab6410d959da26d93f69cb838e2eee75e0e3

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