OpenMind self-hosted Riva ASR API Reference. To streamline integration with the Riva ASR API, we offer a simple package for seamless interaction within OM1.

To minimize latency, the API endpoint utilizes WebSockets for efficient real-time communication.

wss://api-asr.openmind.org?api_key=<YOUR_API_KEY>

Installation

Install the OM1 package:

install OM1
uv pip3 install git+https://github.com/OpenmindAGI/OM1.git

If you don’t have uv installed, you can install it using the following command:

install OM1
pip3 install git+https://github.com/OpenmindAGI/OM1.git

Usage

The following example demonstrates how to interact with the Riva ASR API using the OM1 package:

usage
import time
from om1_utils import ws
from om1_speech import AudioInputStream

# Initialize the Riva ASR API
ws_client = ws.Client(url="wss://api-asr.openmind.org?api_key=<YOUR_API_KEY>")
audio_stream_input = AudioInputStream(audio_data_callback=ws_client.send_message)

# Start the Riva ASR API
ws_client.start()
audio_stream_input.start()

# Retrieve the Riva ASR API response
ws_client.register_message_callback(lambda msg: print(msg))

while True:
  time.sleep(1)

The expected response from the Riva ASR API will be in the following format:

response
{
  "asr_reply": "hello world"
}