https://github.com/engrzulqarnain/openai_realtime_react_voice_agent
https://github.com/engrzulqarnain/openai_realtime_react_voice_agent
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/engrzulqarnain/openai_realtime_react_voice_agent
- Owner: ENGRZULQARNAIN
- Created: 2024-10-11T12:17:11.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-10-20T18:42:27.000Z (7 months ago)
- Last Synced: 2024-10-25T16:07:10.215Z (7 months ago)
- Language: Python
- Size: 87.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ReAct with OpenAI Real-Time Voice API
This repository demonstrates how to integrate the OpenAI Real-Time Voice API as a reasoning engine within a ReAct framework, enabling seamless connections to various tools. This setup allows for voice-driven interactions that enhance user experiences and automate tasks effectively.
## Table of Contents
- [Introduction](#introduction)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Example Scenarios](#example-scenarios)
- [Contributing](#contributing)
- [License](#license)## Introduction
ReAct (Reasoning and Acting) is a paradigm that combines reasoning with action, allowing applications to perform tasks based on user input. By incorporating the OpenAI Real-Time Voice API, this project enables voice interactions that trigger reasoning processes, connecting with various tools and services.
## Prerequisites
Before you begin, ensure you have the following installed:
- Python 3.7 or later
- Node.js (for front-end interaction)
- Access to the OpenAI API
- Any additional libraries specified in the `requirements.txt`## Installation
1. **Clone the Repository:**
```bash
git clone [https://github.com/yourusername/repo-name.git](https://github.com/ENGRZULQARNAIN/openai_realtime_react_voice_agent.git
cd openai_realtime_react_voice_agent
```2. **Install Dependencies:**
For Python:
```bash
pip install -r requirements.txt
```For Node.js (if applicable):
```bash
cd frontend
npm install
```3. **Set Up Environment Variables:**
Create a `.env` file in the root directory and add your OpenAI API key:
```plaintext
OPENAI_API_KEY=your_api_key_here
```## Usage
1. **Start the Server:**
For Python backend:
```bash
python app.py
```For Node.js frontend:
```bash
cd frontend
npm start
```2. **Interact via Voice:**
Use your microphone to speak commands. The OpenAI Real-Time Voice API will process the audio and trigger appropriate actions based on your input.
3. **Connect with Tools:**
The application can be configured to interact with various tools (e.g., Google Calendar, weather APIs). Update the integration settings in `config.py` to customize tool connections.
## Example Scenarios
- **Task Management:** Add, update, or delete tasks using voice commands.
- **Calendar Events:** Create or query calendar events with simple voice prompts.
- **Weather Updates:** Ask for the current weather or forecasts.
## ContributingContributions are welcome! Please follow these steps:
1. Fork the repository.
2. Create a new branch: `git checkout -b feature/YourFeature`.
3. Make your changes.
4. Commit your changes: `git commit -m 'Add some feature'`.
5. Push to the branch: `git push origin feature/YourFeature`.
6. Open a pull request.## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.