Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kazuma512/chatgpt-fastapi
This is a simple API project that calls the ChatGPT API using FastAPI.
https://github.com/kazuma512/chatgpt-fastapi
chatgpt-api fastapi kazuma512 python third-party-api
Last synced: about 2 months ago
JSON representation
This is a simple API project that calls the ChatGPT API using FastAPI.
- Host: GitHub
- URL: https://github.com/kazuma512/chatgpt-fastapi
- Owner: kazuma512
- Created: 2024-04-16T09:15:12.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-16T13:48:27.000Z (8 months ago)
- Last Synced: 2024-04-16T16:36:43.422Z (8 months ago)
- Topics: chatgpt-api, fastapi, kazuma512, python, third-party-api
- Language: Python
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chatgpt-fastAPI
## Introduction
This is a simple API project that calls the ChatGPT API using FastAPI.## Installation
```bash
pip install -r requirements.txt
```## Usage
```python
async def ask_gpt(input_text):
completion = await client.chat.completions.create(model="gpt-3.5-turbo", messages=[{"role": "user", "content": input_text}])
return completion.choices[0].message.content
```