Skip to content

usathyan/sse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0cf47e8 · Feb 2, 2024

History

2 Commits
Feb 2, 2024
Feb 2, 2024
Feb 2, 2024
Feb 2, 2024
Feb 2, 2024

Repository files navigation

Sample OpenAI SSE Engine

This is an openai SSE (server side engine) example that accepts curl commands against a local server. You can issue commands such as

curl -X 'GET' \
  'http://127.0.0.1:8000/?msg=who%20are%20you%3F' \
  -H 'accept: application/json'

It uses a FastAPI engine - https://fastapi.tiangolo.com/ This code uses an ASGI service called uvicorn. https://www.uvicorn.org/

To get started:

  1. git clone this repo
  2. .venv/bin/activate (if on windows, create new venv)
  3. pip install -r requirements.txt
  4. set OPENAI_API_KEY to your key
  5. uvicorn server.app --reload
  6. execute the curl code against this, or go to localhost:8000/docs to get swagger

To do:

  1. Add streaming output
  2. Add Playground UI

About

openai sse example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages