Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
When you create a basic voice agent, it automatically supports adding knowledge for generative answers. The voice-enabled agent formats text-to-speech (TTS) output based on generative answers. Learn more in Tools, knowledge, MCP, and API.
Inform users that responses are AI generated
When you incorporate generative answers into your voice-enabled agent, inform your users of the following points:
AI is used to generate responses.
Users can consult the references your agent uses to generate responses.
Users must verify the accuracy of the generated responses themselves.
Learn more in FAQ for generative answers and FAQ for voice optimization.
The following sample messages are returned to users when you incorporate generative answers messages in a voice-enabled agent.
| Type of message | Description | Example |
|---|---|---|
| AI disclaimer | Message to inform the user that AI might be used, and that the user should verify the information in the message. | "Please note that some responses are generated by AI and might require verification for accuracy. |
| Latency message | Message to inform the user to hold while information is retrieved. | "Please hold while I gather information. <break time="5000ms"/>" The latency message loops, so timeouts should be adjusted. |
| Apology message | Message to apologize to the user if no answer was found. | "I'm sorry, I don't have the knowledge to answer at this time." |
| Hear references | Message to inform the user that they can hear a list of the references used by the AI. | "This response was used by AI and might be incorrect. To hear the references that were consulted, please press 9. To return to the main menu, press star." |
| Barge-in message | Message to inform the user that they can skip listening to references. | "The following references were consulted. Press star at any time to return to the main menu." |
Setup generative answers in your basic voice agent
Provide your agent with at least one knowledge source.
Optionally, configure content moderation.
Test your responses. The received answers should be concise, follow the same language as the input query, and be free of incorrect information. By default, the responses don't include citations and sources.
Access citations and sources from responses
By default, the system automatically removes citations and sources from responses. However, you can retrieve the citations and sources by using the Conversational boosting system topic.
Update the Conversational boosting system topic
Select your agent and select the Topics page.
Select the Conversational boosting system topic.
Select the Create generative answers node, select the three dots (…) of the node, and then select Properties.
Select Advanced and set Save LLM response to Complete (recommended), and Save bot response to the Answer
Topic.Answervariable.Assign the
Answer.Speech.Citationstable variable to a global variable, such asGenAnsVoiceRef.Add a Message node that instructs the caller how to hear the citations. For example, "This response was generated by AI and might be incorrect. To hear the references, please press 9. To return to the main menu, press *."
Optionally, update the knowledge sources, content moderation, and other properties of the generative answers node.
Optionally, configure a latency message for generative answers, or reference a publicly accessible audio file with speech synthesis markup language (SSML) to be played to cover the latency.
Return the citation
Create a topic with one or more of the following nodes to capture and return citations that the agent references.
On the Trigger node, replace the default topic trigger with DTMF global command received, and set the DTMF Key property to 9.
Use Message nodes to inform users that the agent either used a reference or couldn't use a reference to generate a response. For example:
"The following reference was consulted. Press * at any point to return to the main menu."
"No specific references were used to generate the previous answer."
- Use Condition nodes to branch the dialog based on the user's responses. In the left branch, these conditions are met when the user asks a question that utilizes a reference.
Use the left branch of the conditions when the first condition sets the global variable set in the previous steps. For example,
Global.GenAnsVoiceRef. Set the variable tohas value. This branch is also followed by another Message node. Insert aReference.Namevariable, followed by "consulted at," and add another variable,Reference.Url.Use the right branch of the conditions when the user's questions aren't answered or a reference isn't used to return a response. A Message node follows, with a message such as, "No specific references were used to generate the previous answer."
Under the left branch of the condition node, add a Set a variable value node. Set the first variable to Create Variable name and set it to
NumReferences. Set the To value to a formula:Count Rows(Global.GenAnsVoiceRef). Set the Type tonumber, and set Reference toTopic.NumReferences.Set Items to loop over to the
Global.GenAnsVoiceRefvariable in a Loop through a list node. Set the Loop value variable to record type and give it the name, "Reference."Set a Go to another topic node to Main Menu.
Add an End current topic node to complete the topic.
Sample topic YAML to output citations
The following YAML code demonstrates how to create a topic that outputs citations. To speed up the creation of the topic, copy and paste the YAML code into a new topic. To use the YAML code, complete the following steps:
Note
The YAML code relies on assigning the Answer.Speech.Citations table variable to a global variable named GenAnsVoiceRef.
Select your agent and select the Topics page.
Select Add a topic and select From blank.
Open the code editor, and paste the YAML over the existing YAML.
kind: AdaptiveDialog beginDialog: kind: OnDtmfKeyPress id: main dtmfKey: Num9 actions: - kind: ConditionGroup id: conditionGroup_Im7G18 conditions: - id: conditionItem_a2ax5d condition: =!IsEmpty(Global.GenAnsVoiceRef) actions: - kind: SetVariable id: setVariable_dgK3w7 variable: Topic.NumReferences value: =CountRows(Global.GenAnsVoiceRef) - kind: ConditionGroup id: conditionGroup_YRrOBv conditions: - id: conditionItem_hD1dXt condition: =Topic.NumReferences = 1 actions: - kind: SendActivity id: sendActivity_42mrfG activity: speak: - The following reference was consulted. Press * at any point to return to the main menu. elseActions: - kind: SendActivity id: sendActivity_zyZNYz activity: speak: - The following references were consulted. Press * at any point to return to the main menu. - kind: Foreach id: foreach_oWbdVm items: =Global.GenAnsVoiceRef value: init:Topic.Reference index: init:Topic.LoopIndex1 actions: - kind: SendActivity id: sendActivity_CAqLKs activity: speak: - "{Topic.Reference.Name} consulted at {Topic.Reference.Url}" elseActions: - kind: SendActivity id: sendActivity_XHfqKK activity: speak: - No specific references were used to generate the previous answer. - kind: BeginDialog id: zkSWAP dialog: crc82_sophieGenAnswers.topic.Untitled - kind: EndDialog id: MXYSAQClose the code editor and save the topic.