OpenAI Chat API
Project description
OpenAI Chat Python Lib
Requirements
python: >=3.9
Installation
pip install openaichatlib
Usage
from openaichatlib.V3 import Chatbot
bot = Chatbot(
api_key="YOUR_API_KEY",
api_url="YOUR_API_HOST", # default is https://api.openai.com/v1/chat/completions
engine='gpt-3.5-turbo-16k',
timeout=120,
max_tokens=15_000,
proxy="YOUR_PROXY_URL", # like http://127.0.0.1:7890
system_prompt="You are ChatGPT, a large language model trained by OpenAI"
)
reply = bot.ask("Hello")
print(reply)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
openaichatlib-1.0.7.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for openaichatlib-1.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df6705a6dfa034b804124916b2a1570a49efd06bb7f2baf252c6dbf12ca724e |
|
MD5 | 90c4e5417ca2ffc4aca766b76d3dbe30 |
|
BLAKE2b-256 | 16b9096f45fa12965b3fe24141b69535066920ecd5d08940bc95950269be430e |