In-App Copilots
In-App Copilots provide intelligent, context-aware assistance directly within your application, enhancing user experience and streamlining interactions. Use context and guidance to provide dynamic user or product specific information or workflows to guide users through complex tasks or common scenarios.
Context and guidance
Context and guidance can be passed in via the aiChatSettings.
context
context
can be used to provide additional details about the user that might be helpful information for the bot to consider while answering.
Often, this is used to dynamically provide information about the user that can be inferred by their account (if authenticated to your application) or based on the page they are currently viewing.
Examples
For providing context based on the user:
For providing context based on a product:
Frame context as a single phrase or a bullet point list.
context
applies to the entire chat session.
guidance
guidance
can be used to customize the behavior of the bot response using natural language. You can think of guidance
as custom instructions for the large language model.
We've already optimized chat responses to have proper guardrails for staying on topic, tone, brand-protection, etc.
However, guidance
is useful when you want to go beyond the default behavior.
Examples
We recommend using the below format:
guidance
applies to the entire chat session.
Workflows
Workflows allow you to create app-specific flows that are specific to common scenarios your users may face. This often maps to specific tasks in your onboarding or user activation funnel.
Workflows support:
- A custom initial message
- Specifying clarifying questions or information the bot should ask for
- Custom attachment types that can invoke forms, modals, or API calls within your front-end application to gather user-specific information
Example
Workflow
Property | Type | Description |
---|---|---|
id | string | Required. Id of the workflow. |
displayName | string | Required. Label of workflow in the UI. |
goals | string[] | Required. Goals for the workflow, not visible to the user. |
informationToCollect | WorkflowInformationToCollect[] | Required. Information to collect from the user. Learn more. |
botPersona | string | The persona of the bot useful for defining the character, tone, and interaction style the bot will adopt when communicating with users. |
context | string[] | Additional context about this workflow for the LLM, not visible to the user. |
guidance | string[] | Additional guidance for the LLM, not visible to the user. |
initialReplyMessage | string | Required. The reply message from the bot after the user selects a workflow. |
supportedInputs | (WorkflowModalSingleInput | WorkflowFunctionalMultiInput)[] | Configuration for the workflow inputs. Learn more. |
WorkflowInformationToCollect
Property | Type | Description |
---|---|---|
description | string | Required. Description of the information to be collected from the user in order to assist them through the workflow. |
required | boolean | Required. Whether or not this information is required. |
Attachments - Built In Modal
WorkflowModalSingleInput
This input type will open a built-in modal with a form based on the configuration below to collect the user’s information.
Property | Type | Description |
---|---|---|
id | string | Required. Id of the input. |
type | "MODAL" | Required. |
displayName | string | Required. Button label in the UI that opens the modal. |
contentType | WorkflowCodeContentType | WorkflowTextContentType | Required. Type of content user is inputting. Learn more. |
workflowModalProps | WorkflowModalProps | Additional modal configuration. Learn more. |
WorkflowModalProps
Property | Type | Description |
---|---|---|
titleInputLabel | string | Label for the title input. Defaults to "Title" . |
modalHelpText | string | Help text shown in the modal. |
modalHelpElement | ReactElement | Help element shown in the modal. |
WorkflowCodeContentType
Property | Type | Description |
---|---|---|
type | "CODE" | Required. |
contentInputLabel | string | Required. Label for the content input, also provided to the LLM when chat is submitted. |
attachmentIcon | CustomIcon | Icon next to the title in the attachment item. Learn more. |
language | string | Code language. |
WorkflowTextContentType
Property | Type | Description |
---|---|---|
type | "TEXT" | Required. |
contentInputLabel | string | Required. Label for the content input, also provided to the LLM when chat is submitted. |
attachmentIcon | CustomIcon | Icon next to the title in the attachment item. Learn more. |
MessageAttachment
Property | Type | Description |
---|---|---|
contentType | WorkflowCodeContentType | WorkflowTextContentType | Required. Learn more. |
title | string | Required. Attachment title. |
content | string | Required. Attachment content. |
id | string | Required. Attachment id. |
context | string[] | Additional attachment context. |
Attachments - In-app callback
WorkflowFunctionalMultiInput
This input type allows you to provide your own custom logic to pass information back to the chatbot as an attachment. This custom logic might be your own form, modal, or even via APIs that fetch information about a user from your own downstream services.
Property | Type | Description |
---|---|---|
id | string | Required. Id of the input. |
type | "FUNCTIONAL_MULTI_ATTACHMENT" | Required. |
displayName | string | Required. Button label in the UI that triggers the onInvoke function. |
onInvoke | (OnInvokeArgs) => void See below. | Required. Function that runs when the button is clicked. |
OnInvokeArgs
onInvoke
is called with the following arguments:
Property | Type | Description |
---|---|---|
workflow | Workflow | The workflow the user has selected. |
selectedInputType | WorkflowModalSingleInput | WorkflowFunctionalMultiInput[] | The input type the user has selected. |
callback | (messageAttachments: MessageAttachment[]) => void | Function to update the message attachments. This will override what is currently in state so append any new attachments to currentMessageAttachments to avoid removing an attachment. Learn more. |
currentMessageAttachments | MessageAttachment[] | The message attachments that user attached. Learn more. |