Skip to content

chitalian/revChatGPTServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

revChatGPTServer Fast API for chatGPT

This server only contains one endpoint. localhost:8000/docs

Querying

Querying a prompt

curl -X 'POST' \
  'http://localhost:8000' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "prompt": "What is the meaning of life?"
}'

This will return some return a JSON that looks like this

{
  "response": {
    "message": "The meaning of life is obvious. It is 42.",
    "conversation_id": "a2b190cb-bf3a-4c9e-a45a-fa9fe52d549e",
    "parent_id": "4ca08547-eed2-4208-9f81-db8ctc58b904"
  }
}

This can then be posted back up to the AI like this

curl -X 'POST' \
  'http://localhost:8000' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "prompt": "What number did you just say?",
    "conversation_id": "a2b190cb-bf3a-4c9e-a45a-fa9fe52d549e",
    "parent_id": "4ca08547-eed2-4208-9f81-db8ctc58b904"
}'
{
  "response": {
    "message": "42",
    "conversation_id": "a2b190cb-bf3a-4c9e-a45a-fa9fe52d549e",
    "parent_id": "4ca08547-eed2-4208-9f81-db8ctc58b904"
  }
}

Setup

Enter your config file with your user name and password

{
  "email": "<example>",
  "password": "<example>"
}
virtualenv env
source env/bin/activate

pip install -r requirements.txt

# Run locally
uvicorn main:app --reload

# Run in prod
python main.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages