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.3.tar.gz
(20.0 kB
view hashes)
Built Distribution
Close
Hashes for openaichatlib-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a441eb160de2fc0ceaf513fe0023f5d32b4c5fab2e778502c94496035d4e3f |
|
MD5 | 44b78d4c3d3cc1b9661ef717f3d24a5d |
|
BLAKE2b-256 | 27a39f02820c13f968efff540e6218421a995f4fb851193625e804246e7383ee |