Einführung
JSON
Dieser Artikel behandelt die Grundlagen der Migration bestehender aiStudio-Flows von Azure zu Gemini damit Gemini in den aiStudio-Anwendungsfällen aktiviert wird.
⚠️ Es deckt nicht Prompt Engineering oder Testanweisungen und Tipps ab.
Zusätzlich behandelt der Artikel weitere Nuancen nur für Data Collection v2 und Guided Routing v2, da dies die beiden aktiv empfohlenen Anwendungsfälle sind, mit denen gebaut werden soll. Für Hilfe bei älteren Guided Routing- oder Data Collection-v1-Flows wenden Sie sich bitte an LivePerson.
Während wir an einem Update für aiStudio mit neuen Vorlagen arbeiten, können Sie vorläufige Anwendungsfallvorlagen zum Import hier abrufen:
Sichern und exportieren Sie den aktuellen Flow
Bevor Sie versuchen, Ihren bestehenden Flow zu migrieren, sichern und exportieren Sie Ihren aktuellen Flow.
Konfigurieren Sie den LP LLM Gateway-Knoten
Klicken Sie im Formular des Anwendungsfall-Flows auf Flow anzeigen, und klicken Sie dann auf Bearbeiten, um Änderungen an den zugrunde liegenden Knoten im aiStudio-Flow vorzunehmen.
Suchen Sie als Nächstes den LP LLM Gateway-Knoten und konfigurieren Sie ihn wie folgt:
Die obige Konfiguration ist in allen Anwendungsfällen und benutzerdefinierten Flows üblich. Stellen Sie zunächst sicher, dass der LP LLM Gateway-Knoten so konfiguriert ist.
➡️Der einfachste Weg festzustellen, ob ein aiStudio-Flow bereits auf Gemini migriert wurde, besteht darin zu prüfen, ob der LP LLM Gateway-Knoten so konfiguriert ist..
Wenn Sie nicht alle diese Werte sehen, können Sie mehr anzeigen, indem Sie auf das Zahnrad am LP LLM Gateway-Knoten klicken:
Empfehlungen
- Behalten Sie Max tokens bei 16384, damit Antworten nicht abgeschnitten werden.
- Setzen Sie das Thinking Budget auf 0, da Guided Routing V2 und Data Collection V2 bereits eine Begründung in ihrer Generierung eingebaut haben. Dies wird Ihnen Zeit sparen und die Latenz verringern.
Zusätzliche Schritte für Guided Routing v2
Für Guided Routing v2 reicht die Änderung der LP LLM Gateway-Konfiguration aus, um Gemini zu aktivieren.
➡️Es wird jedoch auch empfohlen, Ihre LP Prompts Prompt-Vorlage zu aktualisieren.
Für den Prompt, der mit thinking_chain: verbunden ist,
<ROLE>
{role}
</ROLE>
<TASK>
Bestimmen Sie die Absicht des Benutzers und geben Sie ein INTENT-Objekt aus.
- Wenn die Absicht des Benutzers eindeutig ist und mit der einzigen, spezifischsten Absicht übereinstimmt, die explizit in der INTENT_LIST definiert ist, setzen Sie action auf "intent" und füllen das intent-Feld mit dem passenden Tag aus.
- Wenn die Absicht unklar, mehrdeutig, themenfremd, nicht in der Liste enthalten ist oder mehrere Absichten vorhanden sind, setzen Sie action auf "disambiguate" und intent auf null.
</TASK>
<ACTIONS_HISTORY>
{actions_history}
</ACTIONS_HISTORY>
<INTENT_LIST>
{intent_list}
</INTENT_LIST>
<OUTPUT_FORMAT>
'{{'
' "reasoning": "Erklären Sie kurz Ihre Entscheidung unter Bezugnahme nur auf die bereitgestellten Eingaben. Erfinden Sie keine Intent-Tags oder Beschreibungen.",'
' "action": "intent" | "disambiguate",'
' "intent": str | null'
'}}'
</OUTPUT_FORMAT>
Für den Prompt, der mit speaking_chain: verbunden ist,
<ROLE>
{role}
</ROLE>
<PERSONA>
{persona}
</PERSONA>
<TASK>
Antworten Sie dem Benutzer und fügen Sie optional eine Route hinzu. Sie können nur:
- Den Benutzer weiterleiten,
- Klärende Fragen stellen, um die Absicht zu bestimmen,
- Fragen nur mit den Ihnen bereitgestellten Informationen beantworten.
<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