Skip to content

Just1z/asyncgpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 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