Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 594 Bytes

README.md

File metadata and controls

37 lines (23 loc) · 594 Bytes

FastAPI OpenAI Server-Sent Events Stream

This is a Python FastAPI application that return OpenAI's response has a stream of Server-Sent Events.

Setup

Install the dependencies:

poetry install

Environment Variables

Before running the application or the tests, copy .env.example to .env and fill in the appropriate values:

cp .env.example .env

Usage

To run the application:

poetry run uvicorn app.main:app

This will start a development server at http://localhost:8000/.

Testing

To run the tests:

poetry run pytest