Skip to content

A Laravel application to demonstrate using Server-Sent Events with the OpenAI Chat Streaming API

Notifications You must be signed in to change notification settings

bhaidar/laravel-server-sent-events

Repository files navigation

Laravel Logo

Build Status Total Downloads Latest Stable Version License

Server Sent Events in Laravel and OpenAI API

Server-Sent Events Integration in Laravel Application

This repository showcases the utilization of server-sent events within a Laravel application, emphasizing the seamless integration of the OpenAI API for real-time chat streaming.

Project Overview

The focal point of this project is the development of a streamlined chat interface, harmonizing the dynamic interaction between users and the OpenAI API through the utilization of server-sent events. The application's core functionality revolves around users posing inquiries, to which OpenAI furnishes responses. This exchange of information is achieved through the continuous streaming of responses, employing the server-sent events capability.

Local Deployment

To experience this application firsthand on your local machine, you can follow these steps:

  1. Clone Repository: Begin by cloning this repository to your local environment.

  2. Install Dependencies: Utilize the composer package manager to install all essential PHP dependencies.

  3. Local Environment Setup: With the aid of Laravel Sail, this application can be readily set up and executed locally. Ensure that Docker is installed on your system. Then, proceed with the subsequent commands:

    sail up -d
    sail npm install
    sail npm run dev
    

Disclaimer

It's important to note that this application exclusively serves as a demonstration, thereby rendering it unsuitable for deployment in a production environment.

Contact Information

Should you be interested in further exploring similar projects for potential production applications, feel free to get in touch with me at: bhaidar@gmail.com.

We hope you find this demonstration both informative and insightful. Thank you for your interest and exploration!

About

A Laravel application to demonstrate using Server-Sent Events with the OpenAI Chat Streaming API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published