Skip to content

Latest commit

 

History

History
67 lines (43 loc) · 954 Bytes

README.md

File metadata and controls

67 lines (43 loc) · 954 Bytes

Summary API

This API for summarize input prompts with ChatGPT and returns a summarized text.

I developed this to test and have knowledge about FastAPI.

Clone

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}"

Run

Install the modules.

pip install -r requirements.txt

Run the server with uvicorn.

uvicorn main:app --reload

Endpoints

about

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."
}

summarize

POST:http://localhost:8000/summarize

body

{
  "text": "Some text"
}

returns

{
  "response": "summarized text"
}