Skip to content
프로젝트

cameronking4/openai-realtime-api-nextjs

GitHub에서 보기

소개

Leverage the OpenAI Realtime API (12-17-2024) with this Next.js 15 starter template featuring shadcn/ui components, tool-calling & localization. Use starter to build Voice AI apps with WebRTC.

웹 및 앱 개발

이 수치를 측정하는 방법

What you can do

  • Next.js Framework: Built with Next.js for server-side rendering and API routes.
  • Modern UI: Animated using Tailwind CSS & Framer Motion & shadcn/ui.
  • Use-WebRTC Hook: A hook to abstract the OpenAI WebRTC handling.
  • Tool Calling: 6 example functions to demonstrate client side tools along with Realtime API: getCurrentTime, partyMode, changeBackground, launchWebsite, copyToClipboard, scrapeWebsite (requires FireCrawl API key)

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

OpenAI WebRTC Shadcn Next15 Starter

This is a WebRTC-based Voice AI stream application using OpenAI's Realtime API and WebRTC. Project contains /api route and UI components developed with Next.js and shadcn/ui. It supports real-time audio conversations implented in skrivov/openai-voice-webrtc-next with the addition of a hook to abstract the WebRTC handling.

https://github.com/user-attachments/assets/ea9324af-5c18-48d2-b980-2b81baeea4c0

Features

  • Next.js Framework: Built with Next.js for server-side rendering and API routes.
  • Modern UI: Animated using Tailwind CSS & Framer Motion & shadcn/ui.
  • Use-WebRTC Hook: A hook to abstract the OpenAI WebRTC handling.
  • Tool Calling: 6 example functions to demonstrate client side tools along with Realtime API: getCurrentTime, partyMode, changeBackground, launchWebsite, copyToClipboard, scrapeWebsite (requires FireCrawl API key)
  • Localization: Select language for app strings and the voice agent (English, Spanish, French, Chinese)
  • Type Safety: TypeScript with strict eslint rules (optional)

Requirements

  • Deno runtime or Node.js
  • OpenAI API Key or Azure OpenAI API Key in .env file

Installation

1. Clone the Repository

git clone https://github.com/cameronking4/openai-realtime-api-nextjs.git
cd openai-realtime-api-nextjs

2. Environment Setup

Create a .env file in the root directory:

OPENAI_API_KEY=your-openai-api-key

3. Install Dependencies

If using Node.js:

npm install

If using Deno:

deno install

4. Run the Application

Using Node.js:

npm run dev

Using Deno:

deno task start

The application will be available at http://localhost:3000.

Usage

  1. Open the app in your browser: http://localhost:3000.
  2. Select a voice and start the audio session.

Deploy to Vercel

Deploy in one-click

Deploy with Vercel

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

관련 프로젝트 살펴보기

불러오는 중…