This API for summarize input prompts with ChatGPT and returns a summarized text.
I developed this to test and have knowledge about FastAPI
.
You have to set OPENAI_APIKEY
env variable on your OS.
## Powershell
$Env:OPENAI_APIKEY = "{YOUR_API_KEY}"
## Linux, MacOS, Windows Bash
export OPENAI_APIKEY="{YOUR_API_KEY}"
Install the modules.
pip install -r requirements.txt
Run the server with uvicorn
.
uvicorn main:app --reload
GET:http://localhost:8000/about
returns
{
"about": "This api is for summarizing an input prompt and returning short summarized text. It is using ChatGPT for the summarization."
}
POST:http://localhost:8000/summarize
body
{
"text": "Some text"
}
returns
{
"response": "summarized text"
}