Just1z / asyncgpt

⚡️ Asynchronous framework for ChatGPT API 🤖

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🤖 AsyncGPT 🤖

AsyncGPT is an open-source unofficial asynchronous framework for ChatGPT API written in Python 3.11 using asyncio and aiohttp

Installation

pip install git+https://github.com/Just1z/asyncgpt

Usage

The simplest usage for now:

import asyncio
import asyncgpt


async def main():
    bot = asyncgpt.GPT(apikey="YOUR API KEY")
    completion = await bot.chat_complete([{"role": "user", "content": "Hello!"}])
    print(completion)


if __name__ == "__main__":
    asyncio.run(main())
    # Hello there! How can I assist you today?

How to get API key?

You should get one on the official OpenAI site

https://platform.openai.com/account/api-keys

About

⚡️ Asynchronous framework for ChatGPT API 🤖

License:MIT License


Languages

Language:Python 100.0%