# ODI Cricket DB with OpenAI Realtime API WebRTC

ODI Cricket DB with OpenAI Realtime API WebRTC

## Links
- App: https://realtime.tigzig.com
- Docs: https://tigzig.com/app-documentation/realtime-voice-webrtc.html

## Tags
database-ai, voice-ai

## Documentation

# RT Voice - OpenAI WebRTC

        ODI Cricket database access. Uses OpenAI Realtime API WebRTC for queries and python charts and stats

## About the App

## Usage Guide

### Key Features

Real-time Voice Communication: Powered by OpenAI's Real-time API using WebRTC for natural conversations.AI Assistant Integration: Advanced language models through OpenAI's Real-time API.Flowise AI Integration: Connected to Flowise AI for enhanced agent capabilities.FastAPI Backend: Robust API server for handling backend operations.Data Visualization: Charts generated dynamically based on LLM agent queries to the backend database.Responsive Design: Mobile-friendly interface with tab-based navigation.Voice Activity Detection: Configurable VAD settings for optimal voice interaction.Database Integration: Connected to database systems for data persistence and retrieval.  

### Voice Interaction

Click the "Connect" button to start a session

- Allow microphone access when prompted

- Speak naturally - the VAD system will detect voice activity

- Adjust VAD settings if needed through the settings panel

### Text Chat

- Use the text input field for typing messages

- Press Enter or click Send to submit

- Switch between voice and text modes as needed

### Charts and Documents

- Use the tab navigation to switch between chat, charts, and documents

- Charts are generated by the agent based on request made by the user

- Documents can be viewed and edited through the integrated viewer

## Troubleshooting

Common issues and solutions:

- Connection Issues

Ensure HTTPS is enabled

- Check browser microphone permissions

- Voice Detection Problems

Adjust VAD settings in the configuration panel

- Check microphone input levels

- Ensure proper audio device selection

## Source Code and Build Guides

## Build Guide for REX-RT Realtime Analytics Agent

A single-page vanilla JavaScript/HTML application featuring real-time voice communication powered by OpenAI's Real-time API using WebRTC. This application provides seamless voice interaction, text chat, and data visualization capabilities, all implemented in pure JavaScript without any frameworks.  

## 📚 The App has 3 repos.

#### 1. Main Repository with step by step instructions

[https://github.com/amararun/shared-openai-realtime-webrtc-cricket](https://github.com/amararun/shared-openai-realtime-webrtc-cricket) 

#### 2. FastAPI server with the database connector

[https://github.com/amararun/shared-rexc-cricket-fastapi](https://github.com/amararun/shared-rexc-cricket-fastapi)

#### 3. FastAPI Ephemeral Key Server

[https://github.com/amararun/shared-openai-realtime-fastapi-ephemeral](https://github.com/amararun/shared-openai-realtime-fastapi-ephemeral)  

## 📚 Official Documentation & Guides:

- [OpenAI Real-time Model Capabilities](https://platform.openai.com/docs/guides/realtime-model-capabilities)

- [OpenAI Real-time WebRTC Guide](https://platform.openai.com/docs/guides/realtime-webrtc)

- [OpenAI Realtime Console](https://github.com/openai/openai-realtime-console) - Essential reference implementation showing WebRTC integration, event handling, and component interactions. This codebase provides valuable insights into real-time communication patterns and event logging that you can adapt for your application.
