A minimalistic Python-based GUI for various chatbots
Project description
README
Welcome to KANU, a minimalistic Python-based GUI for various chatbots.
There are currently four chatbots available in KANU:
- ChatGPT harnesses the power of OpenAI's ChatGPT, bringing it directly to your local computer
- DocGPT allows you to effortlessly interact with your documents and ask questions about them
- FuncGPT can answer your questions by making calls to external tools, APIs, or databases
- ChatPaLM harnesses the power of Google's PaLM API, bringing it directly to your local computer
Other features of KANU inclde:
- Customize chatbot parameters (e.g. prompt, temperature, and chunk size) by directly using the GUI or uploading a configuration file
- Customize chat settings (e.g. font size and background color)
- Display token counter and price monitor in chat window
Installation
The recommended way is via pip:
$ pip install kanu
KANU requires a different set of dependencies for each chatbot. You can find the dependencies specific to each chatbot in the Chatbots section.
Running
$ kanu
Chatbots
ChatGPT
The following packages are required to run ChatGPT:
openai # Required.
You can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:
[DEFAULT]
model = gpt-3.5-turbo
temperature = 0.5
prompt = You are a helpful assistant.
[USER]
openai_key =
DocGPT
DocGPT currently supports the following document formats: .csv
, .doc
, .docx
, .pdf
, and .txt
.
The following packages are required to run DocGPT:
openai # Required.
langchain # Required.
chromadb # Required.
tiktoken # Required.
pdfminer.six # Optional. Only required for .pdf documents.
unstructured # Optional. Only required for .doc and .docx documents.
tabulate # Optional. Only required for .doc and .docx documents.
You can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:
[DEFAULT]
model = gpt-3.5-turbo
temperature = 0.5
prompt = Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer.
{context}
Question: {question}
Helpful Answer:
chunk_size = 1000
chunk_overlap = 50
[USER]
openai_key =
[OPTIONAL]
new_database_directory =
document_directory =
existing_database_directory =
FuncGPT
The following packages are required to run FuncGPT:
openai # Required.
There may be additional dependencies depending on the external tools, APIs, or databases you use. You are responsible for installing these dependencies.
You can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:
[DEFAULT]
model = gpt-3.5-turbo-0613
temperature = 0.5
prompt = You are a helpful assistant.
[USER]
openai_key =
function_script =
Note that the script provided by the user must contain a dictionary variable defined as functions
, which is imported by FuncGPT. Below is an example script:
import json
def get_current_weather(location, unit="fahrenheit"):
weather_info = {
"location": location,
"temperature": "72",
"unit": unit,
"forecast": ["sunny", "windy"],
}
return json.dumps(weather_info)
get_current_weather_json = {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["location"],
},
}
functions = {
"get_current_weather": {
"function": get_current_weather,
"json": get_current_weather_json,
}
}
ChatPaLM
The following packages are required to run ChatPaLM:
google.generativeai # Required.
You can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:
[DEFAULT]
model = chat-bison-001
temperature = 0.5
prompt = You are a helpful assistant.
[USER]
google_key =
Changelog
See the CHANGELOG.md file for details.
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
Built Distribution
File details
Details for the file kanu-0.9.0.tar.gz
.
File metadata
- Download URL: kanu-0.9.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c595ac8001b4e91eb3f3cf7d520429b5c96ad5afcacc6dd712a65afe01d9aabb |
|
MD5 | 84b3becda21bdde3b5788fb15997d60c |
|
BLAKE2b-256 | 3979b83d889e2331b334820911e71452237dbd3ff31e6f2928d84df4607b20df |
File details
Details for the file kanu-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: kanu-0.9.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/0.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdee91a94e31da7098555eda9f3efa6ffda89c9cd205f4e36cc5ec6f840a77dd |
|
MD5 | fce9ef330ee581c606aa124a7ff07abb |
|
BLAKE2b-256 | bac2f52c8b15429dbe69ff0d308489255614cba62b475809da3cb6fc84bfe0b1 |