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:
- git clone this repo
- .venv/bin/activate (if on windows, create new venv)
- pip install -r requirements.txt
- set OPENAI_API_KEY to your key
- uvicorn server.app --reload
- execute the curl code against this, or go to localhost:8000/docs to get swagger
To do:
- Add streaming output
- Add Playground UI