Dynaimc Buttons Function

With the DeepInfra Dynamic Buttons, you can suggest button responses to the user based on the conversation itself. It will use the last AI response & the user's utterance to dynamically suggest 3 potential responses that are relevant to the AI response. Check out the step-by-step guide below to understand how it works exactly.

Guide:

This will not only give some ideas to the user, but also motivate the user to continue on the conversation for more engagement.

Input Variables

Language - The language the buttons should be in (i.e "Italian" or "English")

Max Tokens - The maximum amount of tokens you want the LLM to use in the response (i.e 1000)

License - Your FlowBridge custom functions license found on the Custom Function page on your FlowBridge environment

Ai Response - This is the last response the AI gave (Generally voiceflow uses the {last_response} variable for this). If you are using our Custom Function for querying DeepInfra, you would want this to be the variable you created as output for that step.

User Query - This would generally be the {last_utterance} variable

Model - The model you want to use from DeepInfra

Api Key - Your API key found on the DeepInfra dashboard (See steps below for more info)

System Prompt - The system prompt you want to use for the LLM (i.e "You are a customer support agent trying to help the user")

Output Variables

Question 1 - A potential question for one of the buttons suggesting the user's reply

Question 2 - A potential question for one of the buttons suggesting the user's reply

Question 3 - A potential question for one of the buttons suggesting the user's reply

Step-by-step guide

  1. Navigate to the FlowBridge admin panel

  2. Click "Custom Functions"

  1. Click "Download"

  1. Go to your Voiceflow Project

  2. Click "Functions"

  1. Click here to import the function

  1. Click "Browse"

  1. Click "Browse"

  1. Click "Import"

  1. Click "Workflows"

  1. Double-click on your workflow.

  1. Click here and drag the line somewhere else.

  1. Click "Capture"

  1. Click here.

  1. Click "Response AI"

  1. Click here.

  1. Type "Answer the question of the user below and make sure to ask a follow up question. [[enterenter]] Question: {las"

  2. Click "last_utterance"

  1. Click here and drag the line somwhere.

  1. Click "Function"

  1. Click "Select existing function"

  1. Click "Dynamic Buttons Deepinfra Ouput Variables"

  1. Click here.

  1. Type "English" or any other language you want the buttons in

  2. Click here.

  1. Type "1000" or another number you want to use as the maximum amount of tokens used

  2. Click here.

  1. Go to the FlowBridge custom functions page, and copy your license key

  2. Paste the license key in here

  1. Click here.

  1. Type "{la"

  2. Click "last_response" to get the last response the AI made in your flow.

Make sure you had a Response AI step prior to the function, otherwise the last_reponse variable will not be populated with data.

If you are using the FlowBirdge DeepInfra function for querying the LLM, make sure you set this to the variable used for the output of that function

  1. Click here.

  1. Type "{las"

  2. Click "last_utterance"

  1. Click here.

  1. Click "Models"

  1. Click this icon to copy the LLM name.

  1. Paste the LLM name here

  1. Click "Dashboard"

  1. Click "API Keys"

  1. Click "New API key"

  1. Click the "API Key name" field.

  1. Type "FlowBridge Dynamic Buttons" or the label you want to give this API key

  2. Click "Generate API key"

  1. Click this image.

  1. Paste the api key from DeepInfra here

  1. Click here.

  1. Type the system prompt you want to use like "You are a customer support agent trying to help the user"

  2. Click here.

  1. Type "{"

  2. Click "Create variable"

  1. Type "button1"

  2. Click "Create variable"

  1. Click here.

  1. Type "{"

  2. Click "Create variable"

  1. Type "button2"

  2. Click "Create variable"

  1. Click here.

  1. Type "{b"

  2. Click here.

  1. Type "utton3"

  2. Click "Create variable"

  1. Click here and drag a line somewhere

  1. Click "Buttons"

  1. Click here.

  1. Type "{but"

  2. Click "button1"

  1. Click "Add Button"

  1. Type "{bu"

  2. Click "button2"

  1. Click "Add Button"

  1. Type "{b"

  2. Click "button3"

  1. Click "No match"

  1. Click here.

  1. Click here.

  1. Drag the line from Button1 directly to the Response AI step you want the button to go to (Not on the block, but the response step itself)

  1. Drag the line from Button2 directly to the Response AI step you want the button to go to (Not on the block, but the response step itself)

  1. Drag the line from Button3 directly to the Response AI step you want the button to go to (Not on the block, but the response step itself)

  1. Drag the line from No Match directly to the Response AI step you want the button to go to (Not on the block, but the response step itself)

This will allow the user to type a message rather than forcing them to click a button.

Last updated