# Simple ChatGPT
An extremely simple programmatic interface to ChatGPT. The conversation
automatically gets truncated (from the oldest message) if the token limit is
reached.
The goal of this project is to remove the need for boilerplate code to create
a chat bot in your program, allowing you to jump right into integrating
ChatGPT into whatever you are making.
You can use this package like:
```
from simplechatgpt import Chat
import os
chat = Chat(os.environ["OPENAI_API_KEY"])
while True:
prompt = input("You: ")
print("Bot:", chat.send(prompt))
```
You can choose a model when initializing your `Chat` object like:
```
chat = Chat(os.environ["OPENAI_API_KEY"], model="gpt-4")
```
As of the time of this writing (07/08/2023), the following models are available
for use:
- `gpt-4`
- `gpt-4-32k`
- `gpt-3.5-turbo`
- `gpt-3.5-turbo-16k`
See https://platform.openai.com/docs/models/overview for a full list of
available models.
You can also customize the "system" message to initialize the chat bot to
act in a certain way throughout the conversation. For example,
```
key = os.environ["OPENAI_API_KEY"]
chat = Chat(key, chatbot_description="You are Hucklyberry Finn.")
while True:
prompt = input("You: ")
print("Bot:", chat.send(prompt))
```
Would produce responses like:
```
You: Hey son, how are you?
Bot: Well, I reckon I'm doin' alright Pa. How 'bout yourself?
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Thomas-McKanna/simplechatgpt",
"name": "simplechatgpt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Thomas McKanna",
"author_email": "thomasmckanna@proton.me",
"download_url": "https://files.pythonhosted.org/packages/f9/ae/f388c63b5241eb335aab3f8b2853221271299bbadd0cb5933b1e1321156a/simplechatgpt-1.2.0.tar.gz",
"platform": null,
"description": "# Simple ChatGPT\n\nAn extremely simple programmatic interface to ChatGPT. The conversation\nautomatically gets truncated (from the oldest message) if the token limit is\nreached.\n\nThe goal of this project is to remove the need for boilerplate code to create\na chat bot in your program, allowing you to jump right into integrating\nChatGPT into whatever you are making.\n\nYou can use this package like:\n\n```\nfrom simplechatgpt import Chat\n\nimport os\n\nchat = Chat(os.environ[\"OPENAI_API_KEY\"])\n\nwhile True:\n prompt = input(\"You: \")\n print(\"Bot:\", chat.send(prompt))\n```\n\nYou can choose a model when initializing your `Chat` object like:\n\n```\nchat = Chat(os.environ[\"OPENAI_API_KEY\"], model=\"gpt-4\")\n```\n\nAs of the time of this writing (07/08/2023), the following models are available\nfor use:\n\n - `gpt-4`\n - `gpt-4-32k`\n - `gpt-3.5-turbo`\n - `gpt-3.5-turbo-16k`\n\nSee https://platform.openai.com/docs/models/overview for a full list of\navailable models.\n\nYou can also customize the \"system\" message to initialize the chat bot to\nact in a certain way throughout the conversation. For example,\n\n```\nkey = os.environ[\"OPENAI_API_KEY\"]\nchat = Chat(key, chatbot_description=\"You are Hucklyberry Finn.\")\n\nwhile True:\n prompt = input(\"You: \")\n print(\"Bot:\", chat.send(prompt))\n```\n\nWould produce responses like:\n\n```\nYou: Hey son, how are you?\nBot: Well, I reckon I'm doin' alright Pa. How 'bout yourself?\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An extremely simple interface to ChatGPT",
"version": "1.2.0",
"project_urls": {
"Homepage": "https://github.com/Thomas-McKanna/simplechatgpt"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "797c2266ff05b9879790e4ba8f5bdcfc93b46c65d954c54a8e61482816724e8d",
"md5": "dc8f27a2dbdbbb070183019d4673f218",
"sha256": "d81e6966c170e2c27501a78f8363b6b419e6b677d62311fd84fefb4ef75e740b"
},
"downloads": -1,
"filename": "simplechatgpt-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dc8f27a2dbdbbb070183019d4673f218",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 3620,
"upload_time": "2023-12-02T21:48:39",
"upload_time_iso_8601": "2023-12-02T21:48:39.976889Z",
"url": "https://files.pythonhosted.org/packages/79/7c/2266ff05b9879790e4ba8f5bdcfc93b46c65d954c54a8e61482816724e8d/simplechatgpt-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f9aef388c63b5241eb335aab3f8b2853221271299bbadd0cb5933b1e1321156a",
"md5": "7c2aa67b1e09761ad48c87fbc3654c4e",
"sha256": "058e7dab2c84cecdfe3e39050f11bb0d3b79f8cd39eda85609d9a08469db662d"
},
"downloads": -1,
"filename": "simplechatgpt-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "7c2aa67b1e09761ad48c87fbc3654c4e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 2839,
"upload_time": "2023-12-02T21:48:41",
"upload_time_iso_8601": "2023-12-02T21:48:41.113951Z",
"url": "https://files.pythonhosted.org/packages/f9/ae/f388c63b5241eb335aab3f8b2853221271299bbadd0cb5933b1e1321156a/simplechatgpt-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-02 21:48:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Thomas-McKanna",
"github_project": "simplechatgpt",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "simplechatgpt"
}