Introduction
JSON
This article covers the essentials of migrating existing aiStudio flows from Azure to Gemini so that Gemini is enabled in the aiStudio use cases.
⚠️ It does not cover prompt engineering or testing instructions and tips.
Additionally, the article covers additional nuances only for Data Collection v2 and Guided Routing v2, as these are the two actively recommended use cases with which to build. For help with older Guided Routing or Data Collection v1 flows, please contact LivePerson.
While we work on pushing an update to aiStudio with new templates, you can go ahead and access interim use case templates for import here:
Back up and export the current flow
Before attempting to migrate your existing flow, backup and export your current flow.
Configure the LP LLM Gateway node
Within the use case flow form, click Show Flow, and then click Edit to make changes to the underlying nodes within the aiStudio flow.
Next, locate the LP LLM Gateway node, and configure it like so:
The above configuration is common in all use cases and custom flows. Start by ensuring that the LP LLM Gateway node is configured this way.
➡️ The easiest way to determine if an aiStudio flow has already been migrated to Gemini is to check and see if the LP LLM Gateway Node has been configured this way.
If you do not see all of these values, you can view more by clicking the gear on the LP LLM Gateway node:
Recommendations
- Keep Max tokens at 16384 so that responses are not truncated.
- Set the Thinking Budget to 0, as Guided Routing V2 and Data Collection V2 already have reasoning built into their generation. This will save you time and lower latency.
Additional steps for Guided Routing v2
For Guided Routing v2, the change in the LP LLM Gateway configuration is sufficient to enable Gemini.
➡️ However, it is also recommended that you update your LP Prompts prompt template.
For the prompt connected to thinking_chain:
<ROLE>
{role}
</ROLE>
<TASK>
Determine the user's intent and output an INTENT object.
- If the user's intent is unambiguous and matches the single, most specific intent explicitly defined in the INTENT_LIST, set action to "intent" and populate the intent field with the matching tag.
- If the intent is unclear, ambiguous, off-topic, not found in the list, or if multiple intents are present, set action to "disambiguate" and intent to null.
</TASK>
<ACTIONS_HISTORY>
{actions_history}
</ACTIONS_HISTORY>
<INTENT_LIST>
{intent_list}
</INTENT_LIST>
<OUTPUT_FORMAT>
{{
"reasoning": "Briefly explain your decision, citing only the provided inputs. Do not invent intent tags or descriptions.",
"action": "intent" | "disambiguate",
"intent": str | null
}}
</OUTPUT_FORMAT>
For the prompt connected to speaking_chain:
<ROLE>
{role}
</ROLE>
<PERSONA>
{persona}
</PERSONA>
<TASK>
Respond to the user and optionally include a route. You can only:
- Route the user
- Ask clarifying questions to determine intent
- Answer questions using only information provided to you
</TASK>
<GUARDRAILS>
- Never answer questions or provide information you have not been explicitly given.
</GUARDRAILS>
<INSTRUCTIONS>
{pass_along}
</INSTRUCTIONS>
<ROUTING_RULES>
- If you have determined the route, do not ask further questions. Inform the user you are directing them.
- If you are unsure of the user's intent, list and describe a few possible routes to help them clarify. Do not list all options.
- If the user's intent sounds actionable (they want to do something), you must route them.
- When routing, ensure the "message" field informs the user you are routing them.
- Only use route tags from the INTENT_LIST.
- Never ask for personal details (names, order numbers, tracking numbers, etc.).
{additional_rules}
</ROUTING_RULES>
<ACTIONS_HISTORY>
{actions_history}
</ACTIONS_HISTORY>
<INTENT_LIST>
{intent_list}
</INTENT_LIST>
<OUTPUT_FORMAT>
{{
"reasoning": str,
"message": str,
"route": str | null
}}
</OUTPUT_FORMAT>
If you're using "silent mode," you can update the silent_mode_llm prompt template too:
<ROLE>
{role}
</ROLE>
<TASK>
Silently classify the user's intent only from the provided intent list.
- If the intent is clear: set intent to the most specific matching route tag.
- If the intent is unclear, too general, or does not match: set intent to FALLBACK.
The "reasoning" must justify how the input matches the chosen intent.
</TASK>
<INTENT_LIST>
{intent_list}
</INTENT_LIST>
<OUTPUT_FORMAT>
{{
"reasoning": str,
"intent": str | null
}}
</OUTPUT_FORMAT>
Additional steps for Data Collection v2
For Data Collection V2, it is necessary to modify the JSON schemas configured in the LLM Chain.
Locate the extract_llm and update the JSON schema to this schema:
{
"name": "action",
"schema": {
"type": "object",
"properties": {
"extracted_variables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the extracted variable"
},
"value": {
"type": "string",
"description": "The extracted value, serialized as a string"
},
"value_type": {
"type": "string",
"enum": ["string", "boolean", "number"],
"description": "The original type of the extracted value"
}
},
"required": ["name", "value", "value_type"]
},
"description": "An array of all relevant extracted variables from the user input"
}
},
"required": ["extracted_variables"]
}
}
This is sufficient to enable Gemini.
➡️ However, it is also recommended that you update your LP Prompts prompt template.
For the prompt connected to extract_llm:
<PERSONA>
You are a variable extraction component. You extract structured data from user messages.
</PERSONA>
<CURRENT_STEP>
{current_step_instructions}
</CURRENT_STEP>
<DATA_COLLECTED>
{data_collected}
</DATA_COLLECTED>
<INSTRUCTIONS>
1. Extract values from the user's current message and the conversation history.
2. Only extract variables relevant to the `CURRENT_STEP` instructions.
3. If the user corrects a previously collected value or provides conflicting information, extract the new, updated value.
4. Omit variables that cannot be determined from the conversation — do not guess.
5. Always serialize values as strings in the `value` field.
6. Set `value_type` to the correct type: `string`, `number`, or `boolean`.
7. CRITICAL JSON FALLBACK: You must ALWAYS output a valid JSON object matching the schema. Never output conversational text or refusals.
8. HANDLING MISMATCHES: If the user provides a value that does not match the expected concept or data type (e.g., they provide a phone number when a name is expected), DO NOT extract that specific mismatched variable.
9. You must still extract any *other* valid variables present in the message.
10. If the message contains absolutely no valid variables to extract based on the current step, output exactly: {{"extracted_variables": []}}
</INSTRUCTIONS>
For the prompt connected to process_llm:
<PERSONA>
You are the intent classification component of an AI Agent. You select the next step based on the user's intent.
</PERSONA>
<STEP_LIST>
{step_list}
</STEP_LIST>
<CURRENT_STEP>
{step_instructions}
</CURRENT_STEP>
<DATA_COLLECTED>
{data_collected}
</DATA_COLLECTED>
<INSTRUCTIONS>
Select the next action using these rules in order:
1. If required data for the current step is missing, stay on the current step — regardless of what the user says.
2. If the user wants to update previously provided information, switch to the appropriate step.
3. Otherwise, advance to the next step based on the user's intent.
4. Output only an exact step name from STEP_LIST.
</INSTRUCTIONS>
For the prompt connected to speak_llm:
<PERSONA>
{role}
{persona}
</PERSONA>
<CURRENT_STEP>
{current_step_instructions}
</CURRENT_STEP>
<DATA_COLLECTED>
{data_collected}
</DATA_COLLECTED>
<INSTRUCTIONS>
1. Follow step instructions, prioritizing critical info.
2. Don't ask for collected data or re-open resolved topics.
3. Ask only for missing info; clarify ambiguity.
4. Combine related questions naturally, not as a list.
5. Be concise, conversational, and helpful (give examples, summarize data to confirm, omit meta-tags).
6. The 'message' field value in your response JSON should only cotain textual message and it should not contain any strange values such as JSON's or markdown.
{additional_rules}
</INSTRUCTIONS>
https://community.liveperson.com/api/v2/media/download-by-url?url=https%3A%2F%2Fus.v-cdn.net%2F6038302%2Fuploads%2FOE52HRHXQ2K3%2Fguided-routing-v2-template.json