Skip to content

feat-riva-client-ts-v01 #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AIFlowML
Copy link

TypeScript Client Implementation for Riva SDK

Overview

This PR introduces a TypeScript implementation of the Riva client, which I have ported from our primary Python SDK. While our main SDK implementation remains Python-based (90-99% of our codebase), this TypeScript port was created to support integration with web-based applications and frameworks.

The implementation is particularly timely as we are currently working with the ai16z project to integrate Nvidia models into their ElizaOS framework. This TypeScript client will enable any development team to directly integrate Riva capabilities into their web application stack.

Implementation Details

Directory Structure

  • src/: Core client implementation
    • Client service implementations (ASR, TTS, NLP, NMT)
    • Proto-generated TypeScript definitions
    • Utility functions and base client setup
  • scripts/: Example implementations and usage demos
    • ASR: Streaming and offline transcription examples
    • TTS: Speech synthesis with custom dictionary support
    • NLP: Text classification and analysis utilities
    • NMT: Translation service examples
  • tests/: Comprehensive test suite covering all services

Features Implemented

  • ASR (Automatic Speech Recognition)
    • Streaming transcription
    • Offline file processing
    • Speaker diarization support
    • Word boosting capabilities
  • TTS (Text-to-Speech)
    • Streaming synthesis
    • Custom dictionary integration
    • Multiple voice and language support
  • NLP (Natural Language Processing)
    • Text classification
    • Entity analysis
    • Intent recognition
  • NMT (Neural Machine Translation)
    • Text-to-text translation
    • Batch processing support

Testing

All implemented features have been thoroughly tested with the test suite passing successfully. Tests can be found in the tests/ directory, organized by service type.

Screenshot 2025-01-20 at 08 59 08

Motivation

This TypeScript implementation addresses several key needs:

  1. Enables direct integration with web frameworks and modern JavaScript/TypeScript applications
  2. Supports my ongoing collaboration with ai16z project for ElizaOS framework integration
  3. Provides a native TypeScript solution for developers who cannot use Python directly
  4. Facilitates browser-based and Node.js service implementations

Notes

  • The implementation maintains feature parity with the Python client while adapting to TypeScript/JavaScript conventions
  • All proto definitions are kept in sync with the main Python implementation
  • Open to change anything cosidered not in line with the python

- Complete port of Python client to TypeScript
- Implemented all core services: ASR, TTS, NLP, NMT
- Added comprehensive test suite
- Included example scripts for all services
- Added TypeScript-specific configurations and tooling
- Generated TypeScript proto definitions

This implementation maintains feature parity with the Python client
while providing native TypeScript/JavaScript support for web applications.
@virajkarandikar
Copy link
Contributor

Thank you for your contribution. We will review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants