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.1.5.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file openaichatlib-1.1.5.tar.gz
.
File metadata
- Download URL: openaichatlib-1.1.5.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a8b8c77b7eea10b9af327ac5aaafa30a2b9e24c888869708e3131670f4399e4 |
|
MD5 | af3ffa35a8b9de67c45d1c5f5c6c9eb1 |
|
BLAKE2b-256 | 6c1d1c183043b1dbf676b420d3b81ce8887172c11ab4b86673eba6908255367a |
File details
Details for the file openaichatlib-1.1.5-py3-none-any.whl
.
File metadata
- Download URL: openaichatlib-1.1.5-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9066e6f0056b263970805b7616ec75804cbd6523bb448bcca4d2556801afafbc |
|
MD5 | 65f009dab0fdddf5e3307cc94b41465f |
|
BLAKE2b-256 | 40649f02f5f515907b17b634660a186597b88147fb44510d1b316fb9d4618b17 |