Metadata-Version: 2.1
Name: gptbots
Version: 0.1.13
Summary: A simple Python package for creating and interacting with GPT-based chatbots
Author-email: Carl Vincent Escobar <cvescobar112@protonmail.com>
License: Copyright (c) 2024 Carl Vincent Escobar
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Keywords: openai,gpt,chatbot,chatbots
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: openai

# gptbots
A simple Python package for creating and interacting with GPT-based chatbots

## Preliminaries
Make sure your OpenAI API key is setup (see [OpenAI's Quickstart tutorial](https://platform.openai.com/docs/quickstart?context=python)).

## Usage
To create a chatbot:
- `bot = gptbots.Chatbot()` creates a chatbot instance with default attributes
- `bot = gptbots.Chatbot(model, temperature, custom_instructions, chatbot_name)` creates a chatbot instance with custom attributes

To chat:
- `bot.chat(prompt)` prints chatbot response to string prompt

See more methods below. 

### Attributes
- `model` : default is "gpt-3.5-turbo-1106"; see [OpenAI's documentation on models](https://platform.openai.com/docs/models/) for valid model names
- `temperature` : default is 0.7; ranges from 0.0 to 1.0; higher generally means more creative
- `custom_instructions` : default is "You are a helpful assistant."
- `chatbot_name` : default is "Assistant"
- `context` : contains custom instructions, user messages, and chatbot responses

### Methods
- `chat(prompt)` prints chatbot response to string prompt
- `chat_image(prompt, url)` prints chatbot response to string prompt + image URL when using "gpt-4-vision-preview" (aka GPT-4 Turbo with vision)
- `save(file_path)` saves chat history and settings to preferred file
- `load(file_path)` loads chat history and settings from preferred file
- `print_messages()` prints context without custom instructions in a prettier format
- `print_context()` prints context in a prettier format

