Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 892 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 892 Bytes

🤖 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