Hi Everyone!
We have great news for all AI enthusiasts and ChatGPT users! The much anticipated Zobot integration with ChatGPT Assistant is now available with Plugs.
OpenAI has introduced 'ChatGPT Assistants' to customize GPT models as per your requirement. These Assistants work based on your data, instruction, files, functions and more, making it more susceptible to your needs. With Assistant, your SalesIQ bot can be more powereful than ever, providing contextual assistance to your audience with data specifically exclusive for your business.
Please ensure to have a ChatGPT Assistant in your
OpenAI Platform to use this Plug.
Here's what the SalesIQ chatbot-Assistant brings to the table:
- Targeted Responses: Your bot will be entirely specific to your business, ensuring a tailored experience for your audience, rather than relying on global data.
- Omnichannel Availability: Bot works across all channels, including your mobile app, Website, Facebook, Instagram, WhatsApp, Telegram, and LINE.
- Human-like conversations: Engage your audience with natural, engaging interactions that feel human.
- Always-on availability: Provide 24/7 customer support with your bot, ready to engage with users anytime.
In this post, we will learn how to create a plug and connect your trained ChatGPT Assistant with your bot.
Plug Overview
The ChatGPT Assistant functions based on threads. Initially, you create a thread, add a message to it, and run the message to receive the Assistant's response. So, to integrate ChatGPT Assistant with the Codeless bot builder, we need two plugs.
- Plug 1 - To create a thread (thread ID) using OpenAI API keys.
- Plug 2 - To add a message to the thread using the thread ID, create a run and get the ChatGPT assistance's response.
Help guide to know more about how ChatGPT assistant works
How to build this Plug?
Step 1 - [Plug 1] Creating a thread for the visitor/user
- On your SalesIQ dashboard, navigate to Settings > Developers > Plugs > click on Add.
- Provide your plug a name, and description, and select the Platform as SalesIQ Scripts. Here, we call this plug as ChatGPTAssistantsCreateThread.
- The first step in building the plug is defining the parameters. This plug aims to create a thread and get the thread ID as output. So, only the output parameter (threadID) is needed here.
Copy the code below and paste it into your plug builder. Then, make the following changes.
- In line #2, replace your api_key (Navigate to the OpenAI developer section and click on API keys to create a new one)
- //ChatGPT api key
- api_key = "paste-your-api_key";
- //Header parameters
- headers = Map();
- headers.put("Authorization","Bearer " + api_key);
- headers.put("Content-Type","application/json");
- headers.put("OpenAI-Beta","assistants=v2");
- //This param is needed to use the V2 assistant apis
- // The following webhook will create a thread and return the thread id
- response = invokeurl
- [
- url :"https://api.openai.com/v1/threads"
- type :POST
- headers:headers
- ];
- response_json = response.toMap();
- thread_id = response_json.get("id");
- response.put("threadID",thread_id);
- return response;
- Then, click Save, preview the plug and Publish it.
Step 2 - [Plug 2] Add a message to thread and get response
- From the previous plug, we will get the thread ID as output.
- Create a new plug, here we call this plug as ChatGPTAssistantsCreateRuns.
- Pass the thread ID and the user/visitor input as input parameters.
- Once the plug is executed, we will get the ChatGPT Assistance's response, which is the output parameter.
Input Parameters
- Name: threadID | Type: String
- Name: userInput | Type: String
Output Parameters
- Name: assistantReply | Type: String
Copy the code below and paste it into your plug builder. Then, make the following changes.
- In line #2, replace your api_key (Navigate to the OpenAI developer section and click on API keys to create a new one.)
- In line #3, replace your chatGPT_assistant_id (Navigate to the OpenAI developer scetion > Assistants > choose your Assistant and copy the Assistance ID.
- //ChatGPT api key
- api_key = "paste-your-api_key";
- chatGPT_assistant_id = "asst_4DuWZxC0RNagq0b8pnml4ZPf";
- //Header parameters
- headers = Map();
- headers.put("Authorization","Bearer " + api_key);
- headers.put("Content-Type","application/json");
- headers.put("OpenAI-Beta","assistants=v2");
- //Get the thread ID from the plug input parameters
- thread_id = session.get("threadID").get("value");
- user_input = session.get("userInput").get("value");
- info thread_id;
- info user_input;
- // Messages API call
- requestBody = Map();
- requestBody.put("role","user");
- requestBody.put("content",user_input);
- jsonRequestBody = requestBody.toString();
- // The following webhook posts a message to the conversation thread
- response = invokeurl
- [
- url :"https://api.openai.com/v1/threads/" + thread_id + "/messages"
- type :POST
- parameters:jsonRequestBody
- headers:headers
- ];
- info response;
- // Runs API call
- requestBody = Map();
- requestBody.put("assistant_id",chatGPT_assistant_id);
- jsonRequestBody = requestBody.toString();
- // The following runs the thread which inturn generates a response once the thread is completed
- response = invokeurl
- [
- url :"https://api.openai.com/v1/threads/" + thread_id + "/runs"
- type :POST
- parameters:jsonRequestBody
- headers:headers
- ];
- response_json = response.toMap();
- run_id = response_json.get("id");
- run_status = "queued";
- retry_count = {1,2,3,4,5};
- for each retry in retry_count
- {
- if(run_status != "completed")
- {
- // The above executed run takes few seconds to complete. Hence a considerable time has to be left before the run is completed and the messages are fetched from the thread can be fetched. Here we wait for 3 seconds assuming the run gets complete within 3 seconds
- getUrl("https://httpstat.us/200?sleep=3000");
- response = invokeurl
- [
- url :"https://api.openai.com/v1/threads/" + thread_id + "/runs/" + run_id
- type :GET
- headers:headers
- ];
- response_json = response.toMap();
- run_status = response_json.get("status");
- }
- }
- // The following webhook fetches the messages from the thread
- getmsg_url = "https://api.openai.com/v1/threads/" + thread_id + "/messages";
- response = invokeurl
- [
- url :getmsg_url
- type :GET
- headers:headers
- ];
- info response;
- response_json = response.toMap();
- // Getting the last message from the thread messages list which is the assistant response for the user input.
- assistant_response = response_json.get("data").get("0").get("content").get("0").get("text").get("value");
- info assistant_response;
- response = Map();
- response.put("assistantReply",assistant_response);
- return response;
- Then, click Save, preview the plug and Publish it.
Step 3 - Adding plugs to the Codeless bot builder
- Navigate to Settings > Bot > Add, provide the necessary information, and select Codeless Bot as the bot platform. You can also open an existing bot.
- Next, click on Plugs under Action cards, select the first plug (ChatGPTAssistantsCreateThread), and provide a name to save the output (thread_id).
- Use the visitor fields card, click save in bot context, and provide a name to store the visit
- Then, select Plug 2 (ChatGPTAssistantsCreateRuns) and pass the value for the parameters
- thread_id (Input) - The output of the previous Plug
- user_input (Input) - The visitor's question/input from visitor fields card.
- assistant_reply (Output) - The final response from the ChatGPT assistance.
- Finally, use any response/input card to display the response to the visitor by typing the % to get the context variable (%assistant_reply%) in the message text box. Here, the button card is used along with the follow-up actions.
Note:
- The ChatGPT Assistant APIs are still in beta, so it's better to have a fallback flow in the bot until they are stable.
- Manage the plug failure instances within the plug failure leg by directing your users to operators using the "Forward to Operator" card or use the "Busy response" card to get the user's question, put them on the missed chats. Additionally, you can also "Send Email" card to notify yourself about the user's inquiry.
- The buttons, "I've another question", is used to get next question from the visitor. Use a Go To card and route it to visitor fields card to ask next question.
I hope this was helpful. Please feel free to comment if you have any questions. I'll be happy to help you.
Best regards
Sasidar Thandapani
Recent Topics
Zoho Marketing Automation APIs
When I want to create New lead in marketing automation , I want to add First Name and Last Name as well along with Email but there is no option like this in API . Can you please give me the API which will fulfill my condition ?
Adding Folders in Android App
Is it possible to create a new email folder within the Zoho Mail Android app? Or can this only be done from the desktop version of Zoho Mail? Cheers!
Collaborative editing of spreadsheets by multiple users simultaneously - Is it really possible?
I work in a SharePoint 2010/SharePoint Server 2010 environment and we use MS Office 2007(Excel 2007) . I have been trying to create a MS Office document which will allow multiple users to work on a spreadsheet simultaneously. For that I have: 1) Created a excel workbook and published as a workspace as suggested by Andrea Kalli in her link: http://www.wonderhowto.com/how-to-collaborate-files-between-sharepoint-and-office-2007-182172/ 2) Set up and saved the Excel Workbook as "Shared" and made it available
Ability for customer to give feedback after receipt of an order
Is there any way we can receive feedback from customers regarding their order after delivery (other than just an email, obviuosly)? This is not the same as product reviews, as it may concern other points, but would ideally have an inbuilt reference to
Issue with EU MArketplace
Hi It's super frustrating that many CRM / Zoho (whatever) extensions are not available in the EU Market place Example: https://marketplace.zoho.com/app/crm/time-tracker-extension-for-zoho-crm For now, can the team address the extension above, but on the
Conversion of functions from Google Spreadsheets
Hello! I use this formula "=QUERY(ResumoOrdemVencimento!A3:O38;"SELECT A,B,C,D,E,F,G,H,I,J,K,L,M,N,O WHERE C != '' ORDER BY C,G")" in Google Sheets but when importing my spreadsheet into Zoho Sheets the formula was not converted. The QUERY function brings data from another spreadsheet, and then I sort and apply conditional formatting. The order of data will change automatically as I update the source spreadsheet. What Zoho Sheets function is equivalent to QUERY? I have some other spreadsheets to
Zoho Books Sandbox environment
Hello. Is there a free sandbox environment for the developers using Zoho Books API? I am working on the Zoho Books add-on and currently not ready to buy a premium service - maybe later when my add-on will start to bring money. Right now I just need a
Zoho Books | Product Updates | November 2024
Hello users, We are back with exciting new features and enhancements in Zoho Books. From multi-criteria workflows to writing off customer opening balances, discover the new updates designed to make your bookkeeping swift. Attach XRechnung to Invoices
Spell check sucks
Come on guys, it's 2024 and your spell check is completely retarded. You gotta fix it.
Signature image logo not displaying in recipient mail clients
Whenever I send an email to another person the image that forms part of my logo is not displayed just a broken link to: https://mail.zoho.com/mail/ImageSignature?fileName=Email-log.jpg&accountId=47238000000007001&storeName=NN1:-3205531763309921492 I can see the logo because I've got a zoho account and I'm logged on but others without a zoho account can't see it. How do I fix this? Thanks -Martin
Sales Order, what are the statuses under Confirmed and Closed
Hi, I have to build a workflow in Deluge which should be triggered when Sales Order status is Confirmed or Closed. But these 2 states don't exist when you fetch a sales order. Which of the statuses are considered as Confirmed or Closed ? Here is a list
Notifications for calendar meetings
So we have been happy users for a few months now. This is an important problem we face, since I have forgotten meetings already cause of lack of notifications. The problem: I have notifications (email, popup and notifications) set for my calendar by default.
attributed automatically database section
Hello everyone and happy holidays... here in zoho CRM, I created 3 bases: - Properties (House, apartment ...) - Transactions (Notaries, ...) - Real estate ads I want when the address is identical on these three bases, that in "Properties" the transactions
Reusuable Sections & Universal Brand Settings
Zoho Email Campaign setups take longer than other software I've used because it doesn't have reusable sections or universal brand settings (fonts and colors). These enhancements should be added to help us create our campaigns more easily.
Blockchain technology
Blockchain technology is being used to revolutionize accounting and financial reporting. With blockchain, financial transactions are recorded on a decentralized ledger, making tracking transactions and verifying their accuracy easier. This technology
Este domínio já está associado a esta conta
Fui fazer meu cadastro na zoho e quando digitei meu domínio recebi essa mensagem que meu domínio estava associado a uma conta que eu nem faço idéia de quem seja. Como que faço pra resolver isso? Atenciosamente, Anderson Souza.
not able to hit inventory api
when i hit the api with my account keys and the access is provide by the client
Remove County field from Customer Address input screen (or allow input to be deleted)
We are in the USA and have just noticed that there is now a County field in the Customer Address input screen (and maybe other areas of Zoho Books, but this is the one affecting us at the moment). County is not important to our business, and in fact we
553 Relaying disallowed error
Hi, I am receiving a "553 Relaying disallowed" error when sending emails to my domain email address which I have configured in Zoho. However, I am able to receive emails from my domain email to my gmail account. The SPF and MX entries are all configured
Leads and Deals Issue
Hi! Is Zoho having trouble today? I've been experiencing issues today. When I move a deal to closed/won, it previously would require a closing date but today the screen just went blur and the closing date did not pop up. And then under leads, I was trying
!! URGENT My sent mail goes to spam
I tested a few times and every time I send mail out it goes the recipients spam box. Why is it marking my mail as spam? please help me ! thanks
Event Time Zone in meeting invites are confusing users
When sending calendar invites to internal and external users, the first section "Event Time Zone" is confusing people and they are automatically declining events. Can this section please be removed??? It already shows the correct time zone next to the
Request For Quotation (RFQ) module
Hello, Do you have any plans to implement a RFQ module in to ZOHO Inventory? I would like to chose items that I require a price for, select a number of different suppliers to e-mail and have them submit there pricing online. I would then like to see a
Constant Sync Errors 🙄
I'm constantly getting sync error notifications with no actual resolution. Also... I have folders and files with a (!) on the cloud icon, indicating it's not accessible. This has also led to the complete loss of certain folders. Like... the go missing!
Display your zoho contact name when they call your mobile number
As per the title If a contact calls the office number, the contacts name shows on mobile as long as I have their contact details registered in my crm. Is there a way that if the contact calls my mobile, their name can be displayed? Currently just their number shows when they call.
In Zoho Projects, is there a way to create a folders template under documents that can be used once a project is created?
We have a specific folder structure that we would like to use that is standard across every project. Instead of having to create this structure every time a project is created, is there a way to create a template for the folders that can be added?
Custom view for Milestones
Hi, Just an idea for the future... would it be possible to create custom views for the Milestones view under Work Overview ? I usually need to look at this view filtered by project group but the filter doesn't remain when navigating away. A custom view
Zoho Books API Limit Is RIDICULOUS!!!!!!!!!!!!!
The 2,500 API call limit in Zoho Books is about as useful as AOL dialup. Seriously Zoho, not only can I use up 2,500 API calls in no time with my own app but YOUR OWN STUPID IPAD APP blows through them super fast too, so if any one of my clients wants
javax.mail.authenticationfailedexception 535 authentication failed
Hi, I am facing 535 authentication failed error when trying to send email from zoho desktop as well as in webmail. Can you suggest to fix this issue,. Regards, Rekha
Out of Office not working
I have set up out of office on zoho mail, however, it does not reply to every mail sent to it. I have tested it by sending several test messages from multiple different email accounts, I will get a response to some of them, but not all of them this is
Always display images from this sender – Is this feature available?
In Zoho mail, I had my "Load external images" setting set to "Ask me", and that's fine. That's the setting I prefer. What's not fine though is I always need to tick "Display now" for each email I get, regardless if I've done that multiple times from several
Simplify your day-to-day sales operations with new List View actions
Greetings everyone, Here are a few enhancements for quick actions in modular List Views that will make your day-to-day CRM operations much easier. List Views in modules display records in rows and columns based on set criteria, and are useful for presenting
How to create a Field with answers as Yes, No> Further if no is selected a new field to be visible to give details
Dear All, I am creating a feedback form in HR Letter. The question is were you satisfied with the work allotted. Expected answer to this is Yes, No. Further if the response is no, then a field to be give to fill more details as to why no was selected.
Some emails are not being delivered
I have this problem where some of my mail just seems to disappear. When I send it, it appears as sent with no mention of any problem, but my recipient never gets it, not even in the Spam folder. Same for receiving, I have a secondary e-mail address, and
Unbilled Items Report?
Hello! Is there any way to display a list of items that remain unbilled, without creating an invoice for each customer to see if the unbilled items box is displayed? ;-) Ben
Making Calls Using ZDialer on Zoho Creator Widgets
The Zdialer Browser Extension does not seem to recognize phone numbers on custom widgets. What is the best way to work around this?
ALL sent mails from my zoho email id go to spam
when we send emails out of Zoho as like Gmail , ALL mails go to spam... more than urgent to get a solution !!!!!!
Não consigo enviar e nem receber e-mails
Estou com problemas pra enviar e receber e-mails. Não consigo enviar (recebo uma mensagem de domínio inválido) e os e-mails que recebo estão voltando. Como devo proceder?
Time Field
Good Day, I have a question, when I save a draft and reload it. Why does the time field format keeps goes from hh:mm to hh:mm:ss? Is there a way I can force it to load to hh:mm only? I have tried example = totime(input.TimeField, "hh:mm") in the -created
Receiving email problem
I can send an email but can't receive from other platform like Gmail
Next Page