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.4.5.dev0.tar.gz (140.4 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.4.5.dev0-py3-none-any.whl (140.8 kB view details)

Uploaded Python 3

File details

Details for the file ojin_client-0.4.5.dev0.tar.gz.

File metadata

  • Download URL: ojin_client-0.4.5.dev0.tar.gz
  • Upload date:
  • Size: 140.4 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.4.5.dev0.tar.gz
Algorithm Hash digest
SHA256 2f471fda8eb72f0db1f6d5f863657986d1d882e8d35059554e9c45031b599f3a
MD5 e4954ea29065aeab6b52c85bee7698e8
BLAKE2b-256 8c0816b0ead9dffd03c12e85243fd7cb2cc64537e2684d3269b9550b97428fc5

See more details on using hashes here.

File details

Details for the file ojin_client-0.4.5.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for ojin_client-0.4.5.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fb94fbb9420f5d99a813b6f2b2b7695a999b71d6ff8f3c55ec83afb1f3e6f6b
MD5 d69adf20f3a93157e7a849c092f44a17
BLAKE2b-256 5c2e434a9499d14dc6ed8375645a767a04556f4a668eecda7cda0a484c82106c

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