Introduction
Floatbot’s Real-Time AI Agent Assist is designed to support customer service agents by providing real-time assistance, automating routine tasks, and suggesting responses based on the context of the conversation. It enhances efficiency and accuracy, helping agents resolve issues more effectively. It utilizes LLMs to improve customer satisfaction.
This guide will walk you through integrating AI Agent Assist into your platform, enabling your agents to generate tailored responses through API requests. Learn how to utilize our endpoints for seamless query handling and enhanced customer support capabilities. This documentation also comprehensively covers all aspects of Floatbot, including a detailed overview of various request types and the corresponding responses available.
Establishing Connection
Hitting the right endpoint
Please access the endpoint provided below to initiate the conversation. This endpoint serves as the primary contact point for establishing communication and exchanging information.
wss://us.floatbot.ai/service/agentassist?channel=nextiva&conversationId=&token=&orgId=&channelType=chat
| Attribute name | Data type | Description |
| conversationId | String | This attribute is used to maintain a unique customer session between client and server |
| token | String | The token will be provided by Floatbot and should be passed to validate the source. |
| orgId | String | Unique organisation ID provided by Floatbot |
Keeping the connection alive
To maintain an active TCP connection, send an asterisk (*) each time you receive one. This ensures the connection remains open and operational. If you do not send (*) back, then the server will close the connection in 2 seconds.
Parameters to be used
| Attribute name | Data type | Description |
| sender | String | This attribute can be “bot” or “user”. |
| kbs | Array | |
| type | String | Type can be any of the item provided below. Please refer Types of Items for more details |
| botId | String | Used to identify correct bot at server side. |
| conversationId | String | Id generated while establishing connection. |
| sessionId | String | Used to differentiate between multiple sessions. |
| ts | Timestamp of the message sent in the below format. (1722861837056) | |
| sockeType | String | The value of this attribute will be “comm” for this response. |
Initiating the communication
As soon as a connection is established, below JSON object will be returned as a welcome message from server side. This can be a welcoming message on behalf of client to the user. This message serves as the initial greeting to acknowledge the successful connection and sets the tone for further interaction.
"sender": "bot",
"kbs": [],
"type": "text",
"text": "Greeting message text",
"botId": "chatbot id",
"conversationId": "conversationId",
"sessionId": "sessionId",
"ts": message timestamp,
"sockType": "comm"
The "Client Messages" section outlines the various request types that must be sent to the Web socket to receive the appropriate responses. Requests can be formatted in one of two ways: as textual requests or as flow invoke requests.
Text Request
Textual requests are employed when the client needs to send only a simple text message to the server in order to obtain a specific response. This format is typically used for straight forward interactions where the server processes the text input and returns the relevant output based on the content of the message.
{
"sockType" : "onUserMessaged", <String>
"text" : "", <String>
"sender" : "user", <String>
"ts" : current timestamp, <Number>
}
Invoke Flow Request
When a request requires the initiation of another process or flow, a flow invoke request should be used. This type of request is sent from the client to the server to trigger the execution of the subsequent flow or process. It is typically employed in scenarios where the current interaction necessitates the transition to a different workflow, enabling the server to manage complex sequences of actions or responses by invoking additional predefined flows.
{
"sockType" : "onUserMessaged", <String>
"text" : "", <String>
"flow" : "flow id", <String>
"sender" : "user", <String>
"ts" : <String>
}
Items represent the various types of output that you may receive in response to a request. These outputs are designed to enhance the user experience by providing relevant information or interactive elements. By utilizing these items, the system improves efficiency and facilitates a more seamless interaction for the agent, ultimately assisting users more effectively and ensuring a smoother workflow.
TEXT
When a query requires a purely textual response, the server will provide the answer in the following JSON object format:
{
"sender" : "bot", <String>
"kbs" : [], <Array>
"type" : "text", <String>
"text" : "Greeting message text", <String>
"botId" : "chatbot id", <String>
"conversationId" : "conversationId", <String>
"sessionId" : "sessionId", <String>
"ts" : message timestamp, <String>
"sockType" : "comm", <String>
}
CODE ITEM
When custom HTML content is required for display purposes, such as presenting tables or other formatted elements, the server will deliver the response in the following JSON object format:
{
"sender" : "bot", <String>
"kbs" : [], <Array>
"type" : "code", <String>
"code" : "HTML Code", <String>
"botId" : "chatbot id", <String>
"conversationId" : "conversationId", <String>
"sessionId" : "sessionId", <String>
"ts" : message timestamp, <Number>
"sockType" : "comm", <String>
}
Notification Item
Notifications from AI, such as alerts for flagged items or notifications of achieved goals, serve to inform agents about significant events or milestones. These notifications provide updates and insights generated by AI processes, helping users stay informed and engaged with relevant information.
{
"sender" : "bot", <String>
"kbs" : [], <Array>
"type" : "notification", <String>
"level" : "flag", <String>
"text" : "notification text", <String>
"botId" : "chatbot id", <String>
"conversationId" : "conversationId", <String>
"sessionId" : "sessionId", <String>
"ts" : notification timestamp, <Number>
"sockType" : "comm", <String>
}
NUDGES
Nudges are quick replies displayed as buttons, facilitating user interaction by offering predefined actions linked to flow IDs. It has multiple clickable buttons, and each button can invoke a flow based on its respective flow ID.
{
"sender": "bot", <String>
"kbs": [], <Array>
"type": "nudges", <String>
"intentName": "heading", <String>
"data": { <Object>
"text": "subtitle",
"buttons": { <Array>
"title": "button title",
"redirect": "flow id (optional)"
},
},
"botId": "chatbot id", <String>
"conversationId": "conversationId", <String>
"sessionId": "sessionId", <String>
"ts": message timestamp, <String>
"sockType": "comm" <String>
}
Let us understand this with an Example, If the nudge has a question asking the gender of the user with options “Male” and “Female”.
The “text” attribute contains the actual String of question i.e. “Please provide your gender”.
The “title” attribute contains the text that contains as a Button title. i.e. “Male” & “Female”.
Below Snippet shows Nudge with multiple buttons.
{
"sender" : "bot", <String>
"kbs" : [], <Array>
"type" : "nudges", <String>
"intentName" : "heading", <String>
"data": { <Object>
"text": "subtitle",
"buttons": { <Array>
[
{
"title": "button title",
"redirect": "flow id (optional)"
},
{
"title": "button title",
"redirect": "flow id (optional)"
}
]
},
"botId" : "chatbot id", <String>
"conversationId" : "conversationId", <String>
"sessionId" : "sessionId", <String>
"ts" : message timestamp, <String>
"sockType" : "comm", <String>
FLOW SUGGESTION
This feature provides actionable suggestions presented to agents as clickable options. Each suggestion triggers a predefined flow, allowing agents to efficiently navigate through processes and tasks based on recommended actions.
{
"sender" : "bot", <String>
"kbs" : [], <Array>
"type" : "flow", <String>
"intentName" : "title or intent name"", <String>
"flowName" : "flow name", <String>
"flowId" : "flow id", <String>
"botId" : "chatbot id", <String>
"conversationId" : "conversationId", <String>
"sessionId" : "sessionId", <String>
"ts" : message timestamp, <Number>
"sockType" : "comm", <String>
}
Multiple items in single JSON
There can be chances, where single response contains multiple items. In that case the single JSON can return Multiple JSON. A sample response for the same is mentioned below.
{
"sender": "bot",
"kbs": [],
"type": "iteams",
"iteams":[
{
"type":"text",
... same as above
},
{
"type": "code",
... same as above
},
{
"type": "quick_reply",
"data": {
"text": "title",
"buttons": [
{
"title":"button title",
"redirect": "flow id(may empty)"
}
...
]
}
},
{
"type": "user_input",
"data": {
"title": "Question to agent"
}
}
],
"botId": "chatbot id",
"conversationId": "conversationId",
"sessionId": "sessionId",
"ts": message timestamp,
"sockType": "comm"
}
AI BASED ARTICLES
Whenever a Knowledgebase article needs to be displayed, below mentioned JSON object will be returned on the request.
{
"sender": "bot", <String>
"sockType": "comm", <String>
"ts": message timestamp, <String>
"kbs": [ <Array>
{
"title": "text",
"link": "external link"
}
...
]
...
}