Skip to content

crisperpo/realtime-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Realtime Demo

This project demonstrates real-time communication using WebSockets and OpenAI's Function Calling API. It is designed as a minimal example to show how you can build an interactive, real-time system powered by AI responses.

πŸš€ Features

  • πŸ”Œ WebSocket server for real-time messaging
  • πŸ€– Integration with OpenAI's Function Calling API
  • πŸ› οΈ Simple, readable Node.js backend

πŸ“¦ Installation

  1. Clone the repository
git clone https://github.com/crisperpo/realtime-demo.git
cd realtime-demo
  1. Install dependencies
npm install
  1. Set up environment variables

Create a .env file in the root directory and add your OpenAI API key:

OPENAI_API_KEY=your-api-key-here

πŸƒ Usage

Start the WebSocket server:

node index.js

Clients can connect to ws://localhost:3000 to send and receive messages.

πŸ’‘ Example Workflow

  1. Client sends a message via WebSocket.
  2. The server processes the message using OpenAI's function calling API.
  3. The response (including structured function output) is sent back to the client in real time.

πŸ“ License

MIT License Built by @crisperpo with πŸ’‘

About

Demo of OpenAi Realtime using WebSockets and OpenAI's function calling API

Topics

Resources

Stars

Watchers

Forks