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
Kiosk Studio wrap-up | How our community used kiosks in 2024
Hello, everyone! Happy new year! The end of 2024 has been busy, and 2025 promises to be bigger and better. As we ring in the new year, let's rewind and look at Kiosk Studio, our no-code customization tool. The past 300 days have seen the CRM community
Create a field in Leads that is displayed in Contacts and Accounts
I am trying to set it up so that if I create a field "Deals" which I have set up in the Deals module, that any selection made in the Leads module when this is converted to Contact that the selection made under the Deals field in the Leads module will
Limit excceding issue in zoho creator
I am transferring data from Zoho Books to Zoho Creator using a Deluge script. However, I am frequently encountering a "limit exceeding error," which seems to be related to the Deluge statements limit. I reached out to Zoho Support, and they informed me
Getter error message Number of statement execution limit exceed Line:(216)
Hi, this script is giving me error message "Number of statement execution limit exceed Line:(216)". Please advise htmlpage Pay_Period_Details(PayPeriodID,AgentID,ShowPrint,start_range,end_range) displayname = "Pay Period Details" content <%{ /* Get The current Pay Period Record */ Int_Pay_Period_ID = PayPeriodID.toLong(); Current_Pay_Period_Record = Pay_Period[ID == Int_Pay_Period_ID]; Previous_Pay_Period_ID = thisapp.Application.GetPreviousPayPeriodID(Current_Pay_Period_Record.ID); /* Checking Agent
Useful enhancements to Mail Merge in Zoho CRM
Dear Customers, We hope you're well! We're here with a set of highly anticipated enhancements to the Mail Merge feature in Zoho CRM. Let's go! Mail Merge in Zoho CRM integrates with Zoho Writer to simplify the process of customizing and sharing documents
How create deal with label added using api
Hi, I am creating automations in n8n for Zoho CRM. I want to create a new deal with a label added at the same time. However, I keep getting an error. Using the API, I can create a deal successfully, but when I try to add a label during the deal creation,
Checklist/ save to onedrive/ a group of items invoicing in Zoho FSM
hi, is there a way to add a specific checklist to any WO without passing eachtime by the model customization? can we save file such picture directly in our sharepoint ak onedrive? is there any way to add a group of item pre defined to make invoicing easier
Message as a bot to user now says: "The message recipient id sent in the API is your own user id. You cannot send messages to yourself."
Hi I used to be able to have a bot message myself in cliq when something happened . Now the connector Message as a bot to user gives me this error when testing: Zoho Cliq says "The message recipient id sent in the API is your own user id. You cannot
Can I Integrate ADP Payroll with Zoho Books?
Hi, I am hoping that I can integrate ADP Payroll with Zoho Books so that I do not need to manually input the payroll journal entries. Is this possible? If so, how do I do that?
Lookup field - Can I avoid using advanced search?
I have a lookup field in my app that has surpassed 500,000 records, now basic search is disabled and I'm forced to use advanced search. That adds multiple steps to what used to be very simple. Before: Select field > Type last digits of product code and
Invalid Value Type Error Conditional Formatting
Hello, I'd like to use conditional formatting on a table using Classic conditional formatting for Cell Value, but when I attempt to apply the formatting, I get the error "Invalid Value Type: Value must be of type number". The error is being produced because
Simplify Zoho API integration with Deluge’s invokeAPI task
Hello all! Happy New Year! As we kick off 2025, we’re excited to share some of the latest updates to enhance your Deluge experience. While Deluge already offered robust API integration capabilities, we’ve taken it to the next level with the introduction
Automation #6 - Prevent Re-opening of Closed Tickets
This is a monthly series where we pick some common use cases that have been either discussed or most asked about in our community and explain how they can be achieved using one of the automation capabilities in Zoho Desk. Typically when a customer submits
Reporting tags
Hi, I suggest to improve the integration with Books, adding the faculty to especify a reporting tag from payment pages. Thanks!
Can I add Conditional merge tags on my Templates?
Hi I was wondering if I can use Conditional Mail Merge tags inside my Email templates/Quotes etc within the CRM? In spanish and in our business we use gender and academic degree salutations , ie: Dr., Dra., Sr., Srta., so the beginning of an email / letter
SEO Support for Jobs
I know Zoho recruit has some very basic metadata settings at the job board level which is not really helpful. We are wanting to utilise SEO and other Google features (like Google Jobs) which require the ability to add structured data to each job posting
Workdrive Oauth2 Token Isn't Refreshing
I have set up oauth for a bunch of zoho apis and have never had a problem with oauth. With workdrive i am using the exact same template i usually use for the other zoho apps and it is not working. All requests will work for the first hour then stops so
Create deal from estimate
Hello, I have integrated CRM and books. I created an estimate on CRM but I would like to allocate that estimate to a deal with the contact. How can I do this please?
Selecting Multiple Transactions
Is there a way to select multiple transactions when in a bank account and batch categorize them?
Email client fails to connect to IMAP & POP EU Servers for ALL users
For the last couple of days, all users on my account are failing to connect to the Zoho EU mails servers. This is using mobile app on various phones & desktop mail clients on different computers. Everything works fine when using webmail & email is still
Email Notification to WordPress Blog Subscribers
You know when a new WordPress blog is published, your subscribers will be notified via email with a link to that blog? Jetpack does it but I'm hoping to get away from it or any other specialized WordPress plugin (like MailPoet), and instead, use a dedicated
Domain verification is in progress... (How long do I need to wait?)
Trying to setup my first email domain by connecting with GoDaddy. Have been here for quite some time and the screen is not changing. How long should this take?Send DataSend Data
Se detectó una actividad inusual para esta IP. Inténtelo de nuevo más tarde.
Recibo el siguiente mensaje al intentar agregar una nueva cuenta de correo electronico a mi dominio @grupomgglobal.com Necesito una respuesta urgente a este asunto ya que he tenido varios inconvenientes con mi el servidor de correo. Si sigo asi creo que
Oops! Something went wrong. Try again later When trying to send email
Hi, This error is appearing everytime i am trying to send an email. Oops! Something went wrong. Try again later Please help.
Stock Count - Extracting Data
Hi, I really like the new stock counting functionality however I can't find any way to extract the stock count results. -The build in stock count report is limited and has no export option - There is no export options from within the stock count screens
Search Option not working
My search option is not working properly. I type in what I'm searching for, and it says not results found. How to I get this issue resolved?
Missing users in CRM workflow notification and "share with zoho cliq"
Hi, I'm creating a workflow that should send a notification to a Zoho Cliq user when a Lead with specific lead source enters the CRM. The problem is that not all users are showing up in the select menu, when I choose "Notify to Zoho Cliq - Users". As
My email client shows no emails anymore
I let my account expire due to old payment method. I repurchased it I turned back on IMAP Then all my emails disapeared. Everything is fine in the webview and and zoho mail app
Question about on User input workflows
In my app I have a field for device IMEI which should trigger a check on an external API through an invokeUrl. But it seems the workflow will only run after the user has moved the focus away from the field by clicking somewhere else. However, if the user
Workaround for Backstage's non-compliant cookie banner
Hi Does anyone has a workaround for the cookie banner Backstage uses when you publish an event? Currently there is no "Decline All Cookies" button, only "Accept All" and "Customise". Which means it is not compliant with data protection requirements, as
Creating a code for Task to event creation
I am looking to automate an event creation to do the following: When a task is created for a user, create an event at 530PM simply called TASKS. This will serve as a reminder that we have at least one task that needs to be addressed. We miss the task
Creating smart filters manually
Hi Team, One of my colleagues accidentally deleted the Notification folder in Zoho Mail. Now all the emails are directing to spam instead of inbox. Is there any way to create the smart filter manually?. With Regards, Logeswar V
Zoho mail stopped receiving emails
My Zoho email addresses that are linked to a domain suddenly stopped receiving messages yesterday, even though I've been using Zoho mail without problems for 1,5 years. I receive this reply to test emails: "553 Relaying disallowed". Due to this, my SMTP
Connecting Zoho Inventory to ShipStation
we are looking for someone to help connect via API shipStation with Zoho inventory. Any ideas? Thanks. Uri
Auto CC - Moving Departments
We have Auto CC e-mail replies to your support mailbox enabled. We have two departments: Helpdesk (helpdesk@domain.com) Delivery (delivery@domain.com) If we create a Helpdesk ticket, and reply, replies are CC'd to helpdesk@domain.com (OK) We then move
Not getting copy of emails sent from Zoho CRM in my email sent box
Where is the setting to make sure I receive a copy of an email I sent to a contact in the CRM in my email SENT folder? (I use gmail) Thanks
Custom image for each contact using merge tag
Hi, I'm wondering if it's possible to set up an email campaign to display a different image for each contact using a custom field for the image url. I tried inserting custom html: <img src='$[UD:APP_IMAGE_URL||]$'/> but the editor seemed to reject this and did not actually add anything to the email template. Has anyone got any ideas? cheers, Jeremy
CASE Module - email function
HI there, I dont know if this has been asked or answered before as i couldnt find it on the forums. Issue: when a new case is raised, it goes under case tab and everything is captured. Then how do i send emails to the client who raised case with the details
Use of External Email Services
Would like the ability to use an external SMTP service to send emails campaigns in Marketing Automation. Services like SendGrid, Maligun Amazon SES, etc
Requiring Proxy
We are trying to get support from a company that uses Zoho assist. When we download the helper it is questing that we put in a proxy. What info do we need for the proxy / or to not need a proxy? I have tried a hot spot and allowing the program through
Next Page