-
-
Notifications
You must be signed in to change notification settings - Fork 35
Bible Chat with ChatGPT API
This wiki page describes how to use "Bible Chat", powered by ChatGPT, integrated in Unique Bible App
(For standalone application, i.e. running ChatGPT-GUI without the bible app, go to https://github.com/eliranwong/ChatGPT-GUI)
Developer: Eliran Wong
![bible_chat](https://user-images.githubusercontent.com/25262722/228618352-1662dbb8-4efa-4582-87d8-3564c666b884.png)
Bible Chat is a Qt-based graphical user interface that uses OpenAI ChatGPT API to generate chat conversations about the bible.
This plugin is a Qt-based graphical user interface that uses OpenAI ChatGPT API to generate chat conversations.
Users need to register an OpenAI account and generate a API key first at: https://platform.openai.com/account/api-keys
Read pricing at: https://openai.com/pricing
ChatGPT web version is available at: https://chat.openai.com/chat
"Bible Chat" uses the same models, but with enhanced features not available at ChatGPT web version.
With "Bible Chat", users can:
-
work with Unique Bible App content directly
-
include latest internet search results in ChatGPT responses
-
enter multiline-message
-
predefine context for chat conversations. With "ChatGPT-GUI", users can specify a context for conversations. For example, enter "about the bible" as the chat context in "Chat Settings", to get ChatGPT responses related to the bible.
-
adjust temperature [What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.]
-
adjust number of choices in ChatGPT responses [How many chat completion choices to generate for each input message.]
-
adjust font size for text display
-
use python plugins, to automate tasks, add predefined context, or to process ChatGPT responses before they are displayed
-
edit, print and save conversations
-
save conversations for offline use
-
search history, based on title or content
-
perform search and replace on chat content
-
oranize chat history into different separate database files
-
enter message with voice-typing
-
use OpenAI image model to generate images
-
support system tray
-
choose to use regular expression for search and replace
![settings](https://user-images.githubusercontent.com/25262722/228627568-cc924af7-a69b-4f1b-9beb-db054551f751.png)
- Launch "Bible Chat" from plugins menu
- Click "Settings" to enter your own OpenAI API key
- Enter your message in message entry field and press Enter key, to start a conversation
1. Select text context and choose a study feature with "Bible Chat" button, to get specific ChatGPT response.
Example of "Bible Chat" study features:
- Word Meaning, Meaning in the Bible, Write a Summary, Write a Sermon, Write a Prayer,
- Key Words, Key Themes, Bible Topic, Bible Theology, Bible Place, Bible Person, Bible Promises,
- Translate Content, Translate Hebrew Verse, Translate Greek Verse,
- Introduce a Book, Summarize a Chapter, Interpret OT Verse, Interpret NT Verse
Users can further customise predefined contexts or study features via use of plugins. read more here
![main_window_integration](https://user-images.githubusercontent.com/25262722/228618374-e6355be2-e208-41dd-b0eb-d6a0e9ed501e.png)
Select "Bible Chat" in book / chapter / verse selection menu, to open book introduction / chapter overview / single-verse interpretation:
![verse1](https://user-images.githubusercontent.com/25262722/228624416-e060a743-a6ef-4b88-abac-1acf5bb0682f.png)
![verse2](https://user-images.githubusercontent.com/25262722/228624424-0efa5d09-a0c6-4ce8-bbb6-8470e3226378.png)
You can launch "Bible Chat" directly via system tray:
![system_tray](https://user-images.githubusercontent.com/25262722/228624429-1b1fdd8f-f999-4d0a-b5a4-e4f49b0daa88.png)
The Bible Chat Window is separated into left and right areas, by a movable splitter. Users can move the splitter to either end to hide one of them.
On the Left, from top to bottom:
-
search entry and button for title - enter text here to search for a title, that contains the entered text, in saved record. You may either press the button or press the "Enter" key after text entry.
-
search entry and button for content - enter text here to search for a content, that contains the entered text, in saved record. You may either press the button or press the "Enter" key after text entry.
-
record list - list of saved records or search results. Select a record to update the content view on the right.
-
"Remove" & "Clear All" buttons - remove selected record or remove all records. Confirmation is required before you proceed the deletion.
-
"Help" button - open this wiki page
On the right, from top to bottom:
-
message input - users enter a message here to begin or continue a conversation. The voice checkbox toggle voice-typing. The send button sends the message. Alternately, users can press the "Enter" key after text entry. When a message is sent, a progress bar is displayed to indicate that the message is being processed.
-
+ / - button - toggle multiline user input for message entry
-
Chat or Image - this determines whether the message to sent to generate a chat response or an image.
-
Content view - display conversation content
-
Search and Replace - update content with search and replace
-
Control interface:
-
Settings - open "Settings" dialog, where you can enter OpenAI API key, orgnisation ID, conversation context, text-to-speech language. In UniqueBible.app the conversation context is set to "about the bible" by default. you may modify the context to get the conversations more focused on a particular context.
-
Temperature - according to OpenAI documentation, temperature means "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic."
-
Choices - according to OpenAI documentation, choices means "How many chat completion choices to generate for each input message."
-
Audio checkbox - toggles audio plackback when a new response is loaded. Users can select default language in "Settings"
-
Editable checkbox - toggles to edit the content view or make it read-only
-
"New" - open a new conversation
-
"Save" saves edited conversation. Each conservation is automatically saved when a new response is loaded. Users may edit and updated the content with this button.
Application menu:
-
New Database - create a new database file
-
Open Database - open an existing database file
-
Save Database as - duplicate the currently opened database a different file
-
New Chat - create a new chat
-
Save Chat - save chat content
-
Print Chat - print chat content
-
Configure - open settings dialog
-
Toggle Dark Theme - toggle between dark and light theme
-
Toggle System Tray - toggle system tray; restart the application is required
-
Exit - Exit the application
![settings](https://user-images.githubusercontent.com/25262722/228627568-cc924af7-a69b-4f1b-9beb-db054551f751.png)
-
OpenAI API Key - enter your OpenAI key
-
Organization ID - enter your organization ID; required for ChatGPT-4
-
API Model - select 'gpt-3.5-turbo', 'gpt-4' or 'gpt4-32k'
-
Max Token - specify maximum token
-
Predefined Context - '[none]' means do not apply any additional context; '[custom]' means apply applying context specified in 'Chat Context' described below; users can add more predefined context via pugins, read more below.
-
Chat Context - enter customized context
-
Apply Context in - 'First Input Only' or 'All Inputs'
-
Latest Online Search Results - check to include; uncheck to exclude
-
Maximum Onine Search Results - specify the maximum number of online search results to be included
OpenAI ChatGPT is currently limited to data up until September 2021. Therefore, ChatGPT itself does not have access to real-time information.
ChatGPT-GUI offers users an option to include the latest internet search results, powered by DuckDuckGo search engine, in ChaptGPT responses.
DuckDuckGo is a search engine that emphasizes user privacy and security, and does not store or track user data like most other search engines do. It was launched in 2008 and has gained popularity among users who are concerned about their online privacy.
You can find the option in "Chat Settings":
![internetOption](https://user-images.githubusercontent.com/25262722/227799933-d0b00fa4-ad9e-4432-bdd5-55a38c0315f5.png)
When latest internet search results are not included:
![ChatGPTwithoutInternet](https://user-images.githubusercontent.com/25262722/227804911-ea755b7c-3004-4e06-be26-9fdab7d4101c.png)
When latest internet search results are included:
![ChatGPTwithInternet](https://user-images.githubusercontent.com/25262722/227799952-65cf6e6f-f1ae-49c4-89f6-b60a0cf7eb25.png)
How to edit a record's title?
Edit the first line of a record to change its title.
Where are database files stored?
Chat database file is stored in folder "chats" by default. The default file is named as "default.chat"
What is the format of the database files?
We use ".chat" as extension for database files to work with the GUI. They are all standard sqlite files.
Can I change the context to make the conversation context to focus on a particular area in bible study?
Yes. Click the "Settings" button to edit the chat context. Change the default "about the bible" to something you want to focus, e.g. "about the new testament in the bible". Press "OK" to close the "Settings" dialog. Click "New" to start a new conversation.
How to use python plugins to process ChatGPT responses before they are displayed?
Create a python file and save it in folder "plugins".
For example, print response on console in addition to displayint it on GUI:
import config
def printOnConsole(text):
print(text) return text
config.chatGPTTransformers.append(printOnConsole)
You may even modify the content before it is displayed on the GUI.
In the python file, append the method that transform the response to config.chatGPTTransformers
For example, change all characters to upper cases:
import config
def convertToUpperCases(text):
return text.upper()
config.chatGPTTransformers.append(convertToUpperCases)
For example, ChatGPT is weak to produce responses in traditional Chinese. The following plugin convert all simplified Chinese into traditional Chinese characters:
import config
from opencc import OpenCC
def convertToTraditionalChinese(text):
cc = OpenCC('s2t')
return cc.convert(text)
config.chatGPTTransformers.append(convertToTraditionalChinese)
How to use plugins to customize input suggestion?
You can customize input suggestions by modifying 'config.inputSuggestions' with use of plugins.
For example:
- Save a python file, e.g. inputSuggestions.py, in folder "plugins".
- Add content, for example:
import config
config.inputSuggestions = config.inputSuggestions + ["Write a summary", "Write an outline", "Write a letter"]
How to use plugins to customize predefined contexts?
You can customize predefined contexts by modifying 'config.predefinedContexts' with use of plugins.
For example:
- Save a python file, e.g. predefinedContexts.py, in folder "plugins".
- Add content, for example:
import config
config.predefinedContexts["Introduction"] = """Write a introduction pertaining to the following content."""
config.predefinedContexts["Summary"] = """Write a summary pertaining to the following content."""
Can I run ChatGPT-GUI without running UniqueBible app?
Yes. For standalone application, read: https://github.com/eliranwong/ChatGPT-GUI
Read https://github.com/eliranwong/ChatGPT-GUI/wiki/Plugins-%E2%80%90-ChatGPT-Function-Calling
You may find latest updates at https://github.com/eliranwong/ChatGPT-GUI/wiki