kanu


Namekanu JSON
Version 0.9.0 PyPI version JSON
download
home_pagehttps://github.com/sbslee/kanu
SummaryA minimalistic Python-based GUI for various chatbots
upload_time2023-07-05 06:50:21
maintainer
docs_urlNone
authorSeung-been "Steven" Lee
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # README

[![PyPI](https://badge.fury.io/py/kanu.svg)](https://badge.fury.io/py/kanu)

Welcome to KANU, a minimalistic Python-based GUI for various chatbots.

There are currently four chatbots available in KANU:

- [ChatGPT](#chatgpt) harnesses the power of OpenAI's ChatGPT, bringing it directly to your local computer
- [DocGPT](#docgpt) allows you to effortlessly interact with your documents and ask questions about them
- [FuncGPT](#funcgpt) can answer your questions by making calls to external tools, APIs, or databases
- [ChatPaLM](#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](#chatbots) section.

## Running

```
$ kanu
```

<a id="chatbots"></a>
## Chatbots

<a id="chatgpt"></a>
### ChatGPT

![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/chatgpt.gif)

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 = 
```

<a id="docgpt"></a>
### DocGPT

![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/docgpt.gif)

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 = 
```

<a id="funcgpt"></a>
### FuncGPT

![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/funcgpt.gif)

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,
    }
}
```

<a id="chatpalm"></a>
### ChatPaLM

![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/chatpalm.gif)

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](https://github.com/sbslee/kanu/blob/main/CHANGELOG.md) file for details.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sbslee/kanu",
    "name": "kanu",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Seung-been \"Steven\" Lee",
    "author_email": "sbstevenlee@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/39/79/b83d889e2331b334820911e71452237dbd3ff31e6f2928d84df4607b20df/kanu-0.9.0.tar.gz",
    "platform": null,
    "description": "# README\n\n[![PyPI](https://badge.fury.io/py/kanu.svg)](https://badge.fury.io/py/kanu)\n\nWelcome to KANU, a minimalistic Python-based GUI for various chatbots.\n\nThere are currently four chatbots available in KANU:\n\n- [ChatGPT](#chatgpt) harnesses the power of OpenAI's ChatGPT, bringing it directly to your local computer\n- [DocGPT](#docgpt) allows you to effortlessly interact with your documents and ask questions about them\n- [FuncGPT](#funcgpt) can answer your questions by making calls to external tools, APIs, or databases\n- [ChatPaLM](#chatpalm) harnesses the power of Google's PaLM API, bringing it directly to your local computer\n\nOther features of KANU inclde:\n\n- Customize chatbot parameters (e.g. prompt, temperature, and chunk size) by directly using the GUI or uploading a configuration file\n- Customize chat settings (e.g. font size and background color)\n- Display token counter and price monitor in chat window\n\n## Installation\n\nThe recommended way is via pip:\n\n```\n$ pip install kanu\n```\n\nKANU requires a different set of dependencies for each chatbot. You can find the dependencies specific to each chatbot in the [Chatbots](#chatbots) section.\n\n## Running\n\n```\n$ kanu\n```\n\n<a id=\"chatbots\"></a>\n## Chatbots\n\n<a id=\"chatgpt\"></a>\n### ChatGPT\n\n![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/chatgpt.gif)\n\nThe following packages are required to run ChatGPT:\n\n```\nopenai # Required.\n```\n\nYou can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:\n\n```\n[DEFAULT]\nmodel = gpt-3.5-turbo\ntemperature = 0.5\nprompt = You are a helpful assistant.\n\n[USER]\nopenai_key = \n```\n\n<a id=\"docgpt\"></a>\n### DocGPT\n\n![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/docgpt.gif)\n\nDocGPT currently supports the following document formats: `.csv`, `.doc`, `.docx`, `.pdf`, and `.txt`.\n\nThe following packages are required to run DocGPT:\n\n```\nopenai       # Required.\nlangchain    # Required.\nchromadb     # Required.\ntiktoken     # Required.\npdfminer.six # Optional. Only required for .pdf documents.\nunstructured # Optional. Only required for .doc and .docx documents.\ntabulate     # Optional. Only required for .doc and .docx documents.\n```\n\nYou can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:\n\n```\n[DEFAULT]\nmodel = gpt-3.5-turbo\ntemperature = 0.5\nprompt = 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.\n\t\n\t{context}\n\t\n\tQuestion: {question}\n\tHelpful Answer:\nchunk_size = 1000\nchunk_overlap = 50\n\n[USER]\nopenai_key = \n\n[OPTIONAL]\nnew_database_directory = \ndocument_directory = \nexisting_database_directory = \n```\n\n<a id=\"funcgpt\"></a>\n### FuncGPT\n\n![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/funcgpt.gif)\n\nThe following packages are required to run FuncGPT:\n\n```\nopenai # Required.\n```\n\nThere may be additional dependencies depending on the external tools, APIs, or databases you use. You are responsible for installing these dependencies.\n\nYou can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:\n\n```\n[DEFAULT]\nmodel = gpt-3.5-turbo-0613\ntemperature = 0.5\nprompt = You are a helpful assistant.\n\n[USER]\nopenai_key = \nfunction_script = \n```\n\nNote 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:\n\n```\nimport json\n\ndef get_current_weather(location, unit=\"fahrenheit\"):\n    weather_info = {\n        \"location\": location,\n        \"temperature\": \"72\",\n        \"unit\": unit,\n        \"forecast\": [\"sunny\", \"windy\"],\n    }\n    return json.dumps(weather_info)\n\nget_current_weather_json = {\n    \"name\": \"get_current_weather\",\n    \"description\": \"Get the current weather in a given location\",\n    \"parameters\": {\n        \"type\": \"object\",\n        \"properties\": {\n            \"location\": {\n                \"type\": \"string\",\n                \"description\": \"The city and state, e.g. San Francisco, CA\",\n            },\n            \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"]},\n        },\n        \"required\": [\"location\"],\n    },\n}\n\nfunctions = {\n    \"get_current_weather\": {\n        \"function\": get_current_weather,\n        \"json\": get_current_weather_json,\n    }\n}\n```\n\n<a id=\"chatpalm\"></a>\n### ChatPaLM\n\n![Alt Text](https://raw.githubusercontent.com/sbslee/kanu/main/images/chatpalm.gif)\n\nThe following packages are required to run ChatPaLM:\n\n```\ngoogle.generativeai # Required.\n```\n\nYou can customize the chatbot parameters by directly editing the configuration file or by using the GUI. The configuration file is in the following format:\n\n```\n[DEFAULT]\nmodel = chat-bison-001\ntemperature = 0.5\nprompt = You are a helpful assistant.\n\n[USER]\ngoogle_key = \n```\n\n## Changelog\n\nSee the [CHANGELOG.md](https://github.com/sbslee/kanu/blob/main/CHANGELOG.md) file for details.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A minimalistic Python-based GUI for various chatbots",
    "version": "0.9.0",
    "project_urls": {
        "Homepage": "https://github.com/sbslee/kanu"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bac2f52c8b15429dbe69ff0d308489255614cba62b475809da3cb6fc84bfe0b1",
                "md5": "fce9ef330ee581c606aa124a7ff07abb",
                "sha256": "bdee91a94e31da7098555eda9f3efa6ffda89c9cd205f4e36cc5ec6f840a77dd"
            },
            "downloads": -1,
            "filename": "kanu-0.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fce9ef330ee581c606aa124a7ff07abb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15767,
            "upload_time": "2023-07-05T06:50:20",
            "upload_time_iso_8601": "2023-07-05T06:50:20.367992Z",
            "url": "https://files.pythonhosted.org/packages/ba/c2/f52c8b15429dbe69ff0d308489255614cba62b475809da3cb6fc84bfe0b1/kanu-0.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3979b83d889e2331b334820911e71452237dbd3ff31e6f2928d84df4607b20df",
                "md5": "84b3becda21bdde3b5788fb15997d60c",
                "sha256": "c595ac8001b4e91eb3f3cf7d520429b5c96ad5afcacc6dd712a65afe01d9aabb"
            },
            "downloads": -1,
            "filename": "kanu-0.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "84b3becda21bdde3b5788fb15997d60c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 13662,
            "upload_time": "2023-07-05T06:50:21",
            "upload_time_iso_8601": "2023-07-05T06:50:21.679423Z",
            "url": "https://files.pythonhosted.org/packages/39/79/b83d889e2331b334820911e71452237dbd3ff31e6f2928d84df4607b20df/kanu-0.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-05 06:50:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sbslee",
    "github_project": "kanu",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "kanu"
}
        
Elapsed time: 0.27004s