Introducción
JSON
Este artículo cubre lo esencial para migrar los flujos existentes de aiStudio desde Azure a Gemini para que Gemini esté habilitado en los casos de uso de aiStudio.
⚠️ No cubre la ingeniería de prompts ni instrucciones y consejos de prueba.
Además, el artículo cubre matices adicionales solo para Data Collection v2 y Guided Routing v2, ya que estos son los dos casos de uso recomendados activamente con los que construir. Para ayuda con flujos antiguos de Guided Routing o Data Collection v1, por favor contacte a LivePerson.
Mientras trabajamos en lanzar una actualización para aiStudio con nuevas plantillas, puede acceder a plantillas interinas de casos de uso para importar aquí:
Hacer copia de seguridad y exportar el flujo actual
Antes de intentar migrar su flujo existente, haga una copia de seguridad y exporte su flujo actual.
Configurar el nodo LP LLM Gateway
Dentro del formulario del flujo del caso de uso, haga clic en Mostrar Flujo, y luego haga clic en Editar para hacer cambios en los nodos subyacentes dentro del flujo aiStudio.
A continuación, localice el nodo LP LLM Gateway y configúrelo así:
La configuración anterior es común en todos los casos de uso y flujos personalizados. Comience asegurándose de que el nodo LP LLM Gateway esté configurado de esta manera.
➡️La forma más fácil de determinar si un flujo aiStudio ya ha sido migrado a Gemini es verificar si el nodo LP LLM Gateway ha sido configurado así.
Si no ve todos estos valores, puede ver más haciendo clic en el engranaje del nodo LP LLM Gateway:
Recomendaciones
- Mantenga Max tokens en 16384 para que las respuestas no se trunquen.
- Configure el Thinking Budget a 0, ya que Guided Routing V2 y Data Collection V2 ya tienen razonamiento incorporado en su generación. Esto le ahorrará tiempo y reducirá la latencia.
Pasos adicionales para Guided Routing v2
Para Guided Routing v2, el cambio en la configuración del LP LLM Gateway es suficiente para habilitar Gemini.
➡️ Sin embargo, también se recomienda actualizar su plantilla de prompt de LP Prompts .
Para el prompt conectado a thinking_chain:
<ROLE>
{role}
</ROLE>
<TASK>
Determine la intención del usuario y genere un objeto INTENT.
- Si la intención del usuario es inequívoca y coincide con la única intención más específica definida explícitamente en la INTENT_LIST, establezca action como "intent" y complete el campo intent con la etiqueta correspondiente.
- Si la intención no está clara, es ambigua, fuera de tema, no se encuentra en la lista o si hay múltiples intenciones presentes, establezca action como "disambiguate" e intent como null.
</TASK>
<ACTIONS_HISTORY>
{actions_history}
</ACTIONS_HISTORY>
<INTENT_LIST>
{intent_list}
</INTENT_LIST>
<OUTPUT_FORMAT>
'{{'
' "reasoning": "Explique brevemente su decisión, citando solo las entradas proporcionadas. No invente etiquetas o descripciones de intención.",'
' "action": "intent" | "disambiguate",'
' "intent": str | null'
'}}'
</OUTPUT_FORMAT>
Para el prompt conectado a speaking_chain:
<ROLE>
{role}
</ROLE>
<PERSONA>
{persona}
</PERSONA>
<TASK>
Responda al usuario e incluya opcionalmente una ruta. Solo puede:
- Dirigir al usuario a una ruta.
- Hacer preguntas aclaratorias para determinar la intención.
- Responder preguntas usando solo la información proporcionada.
</TASK>
<GUARDRAILS>
' - Nunca responda preguntas ni proporcione información que no le haya sido dada explícitamente.'
<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