OpenAI
The settings below are related to the Artificial Intelligence app.
Synchronization
Automatic sync mode
- The automatic sync mode is ready-to-use and does not require any additional settings, Just but credits from https://chat.devad.io/account/?tab=membership Credits Section. Set it at Settings > Artificial Intelligence > OpenAI > Sync mode.
- If you want to activate the chatbot, check Settings > Artificial Intelligence > OpenAI > Chatbot.
- You need to purchase credits to use this option.
Manual sync mode
The OpenAI (ChatGPT) integration gives your chatbot the ability to answer general questions about almost anything you can imagine. To start using it, follow the steps below.
Chatbot
To set up your first chatbot, follow these steps:
- Complete the synchronization process.
- Enable the Settings > Artificial Intelligence > OpenAI > Chatbot option, and save your changes.
- Your chatbot should now be active. The playground is accessible from the Chatbot area, which you can find by clicking the 🙂 smile icon on the left menu. If the chatbot isn’t working, click the Settings > Artificial Intelligence > OpenAI > Troubleshoot problems button and follow the instructions.
- To further improve your chatbot, explore the training and human takeover sections.
Settings
See information about most OpenAI settings here.
Chatbot mode
This feature is related to the Settings > Artificial Intelligence > OpenAI > Chatbot mode option. It allows you to configure the information OpenAI will use to respond to user messages.
- Only general questions OpenAI will respond only to general questions and questions related to previous user messages in the same conversation, without using any information you provide. This is the default setting.
- Only questions related to your sources OpenAI will only respond to questions related to the information you provide. The user messages will be ignored. You have to first train the chatbot with your sources.
- All questions OpenAI will only to questions related to the information you provide, to general questions, and to questions related to previous user messages in the same conversation. You have to first train the chatbot with your sources. This is the recommended mode.
- Assistant Use this mode if you are using an OpenAI Assistant.
OpenaAI Assistant
- Set Settings > Artificial Intelligence > OpenAI > Sync mode to Manual and use your own API key.
- You can use multiple assistants by adding their IDs in Settings > Artificial Intelligence > OpenAI Assistants – Department linking and selecting Assistant in Settings > Artificial Intelligence > OpenAI > Chatbot mode. To activate an assistant, both the assistant and the conversations must be assigned to a department.
- The assistant is used only for the chatbot, and smart replies, not for the message rewriting and other features.
Chatbot
The OpenAI chatbot feature functions similarly to Dialogflow, providing automated responses to user messages. Select the Chatbot mode setting to specify the questions that the chatbot is capable of responding to. Utilize the human takeover feature to enable the chatbot to redirect the chat to a human agent as necessary.
Fallback message
The fallback message is sent when OpenAI is unable to understand the user question. If the Dialogflow chatbot is enabled, the fallback message will be turned off and the Dialogflow chatbot’s fallback message will be utilized instead.
Prompt
The prompt instructs OpenAI on how to respond by providing relevant information that can be utilized to answer user inquiries. To comprehend the process, refer to the example prompts listed below.
If you choose to activate the human takeover feature, you need to tell OpenAI to respond with I don’t know if it is unable to provide an answer to the user’s question. You should always include the following text in the prompt: Respond “I don’t know”, if not sure about the answer.
Prompt – Message rewriting
This prompt instructs OpenAI on how to rewrite a message when the Message rewrite button is active. This prompt should be in English. CHAT.devad.io automatically add the following text when required: and use the user langauge, add greetings.
Replies from the training sources can be utilized with the prompt feature as they are compatible.
Spelling correction
This feature automatically fix any spelling mistakes in the agent’s message.
Training data language
If you are using training data and your chatbot is multilingual, set here the default training data language. Leave it as default if the training data default language is in English.
Smart reply
This feature allow to enable the Smart Reply feature also if the chatbot is not active. If the chatbot is active the Smart Reply feature will use OpenAI automatically.
Dialogflow spelling correction
In the case where Dialogflow is unable to find the appropriate response to the user’s message, this function verifies if there are any spelling errors. If any such errors exist, Dialogflow is prompted again with the correctly spelled version of the message for an accurate response. Although it has a higher priority, this feature can still work together with the Google search spelling correction feature.
Message rewrite button
This feature adds a button to the text field of the conversation area, click on it to rewrite your message and make it more friendly and professional. Greetings will be added automatically if there is no previous agent messages. If your language is not English, you have to edit your agent/admin profile and set the correct language.
Speech recognition
OpenAI supports the use of voice messages through speech recognition. When this option is active, audio messages will be converted to written text.
- You do not need to activate this feature for the chatbot to understand audio messages. The speech recognition feature of the chatbot is always enabled.
- For this feature to work better, the user language should be know. To automatically detect the user’s language, you can enable the language detection feature.
- The text will be displayed alongside the audio player.
- The generated text is compatible with the translation features.
Image recognition
When this option is enabled, the chatbot analyzes and interprets images sent by the users.
- Only GPT-4 models and newer support this feature.
- This feature does not work on localhost, it requires an online server or AWS S3.
Source links
When this option is active, the response will automatically include the links to the sources and training data used for generating the answer. To include articles as sources you have first to set the articles page in Settings > Articles > Articles page URL.
Note data scraping
When this option is active, you will see a menu in the notes panel. The menu enables the automatic extraction of specific information from the user’s messages like login details, URLs, or even the summary of the conversation.
OpenAI parameters
CHAT.devad.io allows you to adjust various OpenAI parameters such as temperature and logit_bias, for more details visit https://platform.openai.com/docs/api-reference/completions/create. Don’t set any values if you don’t know what these parameters do or OpenAI may stop working.
Logit bias
The Logit bias parameter must be JSON string and the keys must be strings, for example: {“2435”:-100, “640”:-100}.
Generate user questions
When this option is active, OpenAI will generate new user questions in real time when you open the chatbot training panel.
Use conversations for training
Automatically use conversations to train the chatbot at regular intervals. You will find the training data in Chatbot > Training > Conversations. The training is done via cron job every 24 hours. Only user and agent messages are used, chatbot messages are ignored. More details here.
Context awareness
When this option is enabled, OpenAI will recognize the context of the web page from which the user is writing the message. The context includes only the page’s meta title and meta description texts. T his option is supported solely for the chat widget and is not compatible with messaging channels.
Training ChatBot
With this feature, your chatbot can undergo training using your website, texts, PDF documents and more. Once the training is successfully completed, the chatbot will be able to answer questions related to your contents.
Training using files
This training process enables you to train the chatbot using PDF and TEXT files.
- To access this feature, navigate to Chatbot > Training > Files.
- Select your files, click the Train chatbot button and await completion of the training process.
- It is only possible to upload files in PDF and TXT formats.
- As soon as the training is completed, the uploaded files are removed.
Training using a website
This training process enables you to train the chatbot using websites.
- To access this feature, navigate to Chatbot > Training > Website.
- Enter the website URLs, click the Train chatbot button and await completion of the training process.
- If you retrain the same website, you must first delete the previous website’s training data; otherwise, only new URLs will be trained.
- You can provide the website URL and all child URLs will be included and crawled, but with large websites, it is more efficient and less prone to errors and infinite link loops to utilize an XML sitemap instead of relying on the website URL. You can create it with a service like https://www.xml-sitemaps.com.
- If you want to train your chatbot using specific pages from your website instead of all of them, you can make use of an XML sitemap. Create one using a tool like https://www.xml-sitemaps.com, and then remove the pages you do not wish to include by editing the file in a text editor. To use the XML sitemap, you need to upload it either onto your server or an external online location. Afterward, add the URL of the sitemap in Chatbot > Training > Website. If your sitemap contains more than 1000 URLs, it’s advisable to split it into multiple files and train the chatbot with one file at a time to prevent server crashes.
- You can upload large files and your XML sitemap with a service like https://tmpfiles.org.
Training via questions and answers
This training process enables you to train the chatbot by adding questions and answers individually.
- To access this feature, navigate to Chatbot > Training > Q&A.
- For more details click here.
Training using articles
This training process enables you to train the chatbot using the articles.
- To train the chatbot add you articles and than click the Train chatbot button. The articles are used as training sources automatically.
- For more details click here.
Training using flows
This training process enables you to train the chatbot using the flows.
- To access this feature, navigate to Chatbot > Flows.
- For more details click here.
Training using conversations
This training process enables you to train the chatbot using the conversations from the users and agents.
- To enable this feature, check the Settings > Artificial Intelligence > OpenAI > Use conversations for training option.
- The training data will begin to be generated in the coming days and will be available in the Chatbot > Training > Conversations area.
- While this method is powerful and automated, it can produce low-quality training data if the responses from your human agents or the user messages are unhelpful or incorrect. We strongly recommend reviewing the training data regularly. This method is not recommended for most chatbots. Use the chatbot training panel instead.
Training using the chatbot training panel
Once you have finished training your chatbot, you may want to continue enhancing it. This feature allows you to select conversation messages and use them to add new questions and answers or improve existing ones. You can open the chatbot training panel from the conversation area by hovering the mouse over a message, opening the message’s menu, and selecting Train chatbot.
- If Dialogflow is active, a new Intent will be added to the main Dialogflow agent.
- If OpenAI is active, the OpenAI chatbot will be trained automatically with the new information. You can control the questions and answers generated from this window from Chatbot > Training > Questions and answers.
- The Services to update option let you choose what chatbots to update. When updating a Dialogflow Intent, a new OpenAI question and answer will be generated.
- The training window is not compatible with OpenAI assistants.
Training using real-time information
This feature allow the chatbot to answers to questions that require real-time information, such as, “What is the temperature in London today?”.
- For more details click here.
Information
- To add new training data, simply train the chatbot again. The previous training data will not be lost, and only the new sources will be added.
- there are character limits for training the chatbot. However, if you are using the PHP or WP version, there are no limits imposed. You can view the character limits here.
- The embedding model is essential for training your chatbot and handling all user messages. We currently use the text-embedding-3-small model. It is necessary for these scenarios and cannot be disabled or changed. You can find pricing information at https://openai.com/pricing. Check out the pricing for the text-embedding-3-small model in the Embedding models section.
- Go to Chatbot > Training > Information, and click the Delete all training data button to remove all previous training data for the chatbot.
- The embeddings are stored as JSON files in the CHAT.devad.io uploads folder and are secured using the password-by-filename approach.
Run the training via cron job
just enable the Settings > Artificial Intelligence > OpenAI > Training via cron job option and the cron job will be activated. You can disregard the instructions below.
To automatically train the chatbot with your website content at regular intervals, create a cron job that runs the URL https://chat.devad.io/include/api.php?open-ai-training=true, or use the command */59 * * * * wget https://chat.devad.io/include/api.php?open-ai-training=true to run it via a command. Replace https://chat.devad.io with your Installation URL, get it from Settings > Miscellaneous > Installation URL. use this URL: https://chat.devad.io/script/include/api.php?open-ai-training=true&cloud=API-TOKEN and replace API-TOKEN with your API token.
- the cron job can be executed at most once every 7 days.
- We strongly recommand providing an XML sitemap instead of the website URL for performance reasons.
- Automatic training is limited to websites; files, Q&A, and articles are excluded. Re-training will delete the previous website training data.
Multilingual training
If your user base is multilingual, you can train the chatbot with content in multiple languages and limit the chatbot to retrieve answers only from the sources in the user’s language. To activate this feature, check the Settings > Artificial Intelligence > OpenAI > Multilingual Training Sources option.
- Files Files currently support only one language.
- Websites The language of the website is detected automatically. For CHAT.devad.io to comprehend the language of your web pages, the <html> must contain the attribute lang.
- Q&A Q&A currently support only one language.
- Articles All article languages are used automatically.
- Conversations If automatic translation is active, only messages in the agent’s language will be used.
FAQ
The information below is related to the Question and Answers section of the chatbot training area. Add questions and answers to the chatbot to improve its performance. The chatbot will use this information to respond to user inquiries.
Question
Enter the user messages that will trigger the answer. Add as many question variations as necessary. For example the questions to the answer I’m a chatbot! could be Who are you?, What are you?, Are you a bot?.
Answer
Enter the text that will be used to answer the user question.
Tools calling
For more details go here.
Set data and actions
Set the specified user values when the question is asked. You will see such values in the user details panel. You can use the following merge fields to assign values extracted from the user messages. Include these fields in the answer and they will be replaced with the actual values: {language}. You can also use this feature to perform actions like assigning departments, agents, and tags to the conversation.
Information
- If OpenAI is not working, click here.
- If Dialogflow is active, the OpenAI query is performed only if the chatbot does not know the answer to the user’s question and if the length of the user’s message is greater than 4 characters.
- The following settings are compatible with OpenAI: smart reply, human takeover, disable for the tickets area, disable during office hours, bot response delay, reply to user emails, reply to user text messages.
- The following Google settings are compatible with OpenAI: multilingual via translation, automatic translation, language detection.
- Set the OpenAI chatbot language from Settings > Chat > Language. Set it to Multilingual if your website supports multiple languages or if your users speak different languages. If you are using messaging channels like WhatsApp, or Instagram, you must detect the user language via language detection. For more details click here.
- If a human takes control, the OpenAI chatbot is deactivated, and is remains deactivated also if the agent goes offline. The Dialogflow chatbot continues to function whenever necessary.
- The default model is gpt-5-mini.
- Consecutive user messages are treated as a single message by the chatbot, resulting in one unified reply