> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Realtime Voice Interface

> Guide to PraisonAI's real-time voice interaction feature with text-to-speech, voice input processing, and financial data integration

<div className="relative w-full aspect-video">
  <iframe className="absolute top-0 left-0 w-full h-full" src="https://www.youtube.com/embed/frRHfevTCSw" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />
</div>

## Features

* Real-time voice input processing
* Text-to-speech output for AI responses
* Seamless integration with OpenAI's realtime API
* Support for various AI models
* Persistent conversation history
* Financial data integration with yfinance

## Getting Started

To use the Realtime Voice Interface, follow these steps:

1. Install PraisonAI with the realtime dependencies:
   ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   pip install "praisonai[realtime]"
   ```

2. Set up your OpenAI API key:

   ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   export OPENAI_API_KEY="your-api-key-here"
   ```

   <Accordion title="Azure OpenAI Configuration">
     To use Azure OpenAI instead of standard OpenAI, configure these environment variables:

     ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
     export OPENAI_API_KEY="your-azure-api-key"
     export OPENAI_BASE_URL="https://your-resource.openai.azure.com/openai/deployments/your-deployment-name"
     export OPENAI_MODEL_NAME="gpt-4o-realtime-preview"
     ```

     The realtime interface will automatically detect the base URL and adjust the WebSocket connection accordingly.
   </Accordion>

3. Launch the Realtime Voice Interface:
   ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
   praisonai realtime
   ```

## Usage

Once the interface is launched:

1. Click the microphone button or press 'P' to start voice input.
2. Speak your message or query.
3. The AI will process your input and respond with both text and voice.
4. You can ask for financial data, which will be fetched using yfinance.
5. The conversation history is maintained for context in ongoing discussions.

## Configuration

You can configure various aspects of the Realtime Voice Interface:

### Environment Variables

| Variable            | Description                                                     | Default                                   |
| ------------------- | --------------------------------------------------------------- | ----------------------------------------- |
| `OPENAI_API_KEY`    | Your OpenAI or Azure OpenAI API key                             | Required                                  |
| `OPENAI_BASE_URL`   | Custom base URL for OpenAI-compatible APIs (e.g., Azure OpenAI) | `https://api.openai.com/v1`               |
| `OPENAI_MODEL_NAME` | Model to use for realtime API                                   | `gpt-4o-mini-realtime-preview-2024-12-17` |

### Model Selection

Choose different AI models for processing. Supported models include:

* `gpt-4o-realtime-preview`
* `gpt-4o-mini-realtime-preview-2024-12-17`

### Voice Settings

Adjust voice characteristics for the AI's speech output through the session configuration.

### Audio Settings

Configure input/output audio formats and quality. The interface uses PCM16 format by default for optimal compatibility.

## Troubleshooting

If you encounter issues:

* Ensure your microphone is properly connected and permitted in your browser.
* Check your internet connection for stable real-time communication.
* Verify that your OpenAI API key is correctly set and has the necessary permissions.

For more detailed information and advanced usage, please refer to the [PraisonAI documentation](https://praison.ai/docs).
