$last-action.name = "query_order" AND $last-action.status != SUCCESS
$last-action.name = "query_order" AND $last-action.output.orders = null
操作
触发器触发且可选条件评估完成后,您可以配置以下操作:
向最终用户提供响应:文本、条件响应、自定义载荷和预先录制的音频。提供文本时,您可以插入 [pause]、[pauseShort] 或 [pause long],以便在代理的语音中插入暂停。
示例:How can I help you today? [pause long] I can help with...。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eThis page explains conditional actions, an optional feature for playbooks that allows for more control over agent behavior beyond default LLM-driven interactions.\u003c/p\u003e\n"],["\u003cp\u003eConditional actions are activated by triggers, such as lifecycle stages (like playbook start or before an LLM action) or events (like custom events or no user input).\u003c/p\u003e\n"],["\u003cp\u003eAfter a trigger, optional conditions can be evaluated using a specific syntax to determine if an action should be initiated, similar to how flow routes operate, with no conditions causing the trigger to initiate actions.\u003c/p\u003e\n"],["\u003cp\u003eConditions can reference session parameters, playbook input parameters, and details about the last or next action, including their name, input, output, and status.\u003c/p\u003e\n"],["\u003cp\u003eUpon trigger and condition evaluation, a variety of actions can be configured, including responding to the user, overriding LLM actions, modifying speech settings, and enabling features like barge-in or DTMF.\u003c/p\u003e\n"]]],[],null,["# Conditional actions\n\nBy default,\nplaybooks use LLMs to control the conversation,\ntake actions, and respond to end-users.\nIf you need more explicit control over the agent's behavior,\nyou can use\n[flows](/dialogflow/cx/docs/concept/flow)\nor *conditional actions*, which are described in this guide.\n\nConditional actions are an optional configuration for playbooks.\nYou can set conversation triggers and conditions that invoke specific actions\nlike responding with a specific message,\ncalling an external tool,\ninvoking another playbook,\nor performing any other specified action.\n\nTriggers\n--------\n\nYou can define triggers that are the first step\nin determining whether a conditional action is applicable.\nThe following describes trigger types\nand the specific triggers for each type:\n\n- **Lifecycle stage**\n - **Playbook start**: Triggered the first time a playbook is started.\n - **Before the LLM decides its next action**: Triggered every time before the LLM predicts the next action.\n - **Before the LLM executes its next action**: Triggered every time before the LLM executes an action.\n- **Event**\n - **Custom event**\n - **No input from user**\n\nConditions\n----------\n\nOnce a trigger occurs,\nthe second step is to evaluate any optionally supplied conditions.\nConditions are supplied using the same\n[condition syntax](/dialogflow/cx/docs/reference/condition)\nused by flow routes.\n\nIf no conditions are supplied,\nthe trigger alone will be used to initiate actions.\n\nYou can use the following syntax to reference parameters\nand last/next actions:\n\n- Session parameters\n - `$session.params.PARAMETER_NAME`\n- Playbook input parameters\n - `$playbook.input.INPUT_FIELD_NAME`\n- Last action (previously executed action)\n - `$last-action.name`\n - `$last-action.input.INPUT_FIELD_NAME`\n - `$last-action.output.OUTPUT_FIELD_NAME`\n - `$last-action.status`\n- Next action (LLM predicted next action)\n - `$next-action.name`\n - `$next-action.input.INPUT_FIELD_NAME`\n\nYou can also use\n[system functions](/dialogflow/cx/docs/reference/system-functions).\n\nExamples:\n\n- `$session.params.current_user = null`\n- `$last-action.name = \"query_order\"`\n- `$last-action.name = \"query_order\" AND $last-action.status != SUCCESS`\n- `$last-action.name = \"query_order\" AND $last-action.output.orders = null`\n\nActions\n-------\n\nOnce a trigger and optional condition evaluation have occurred,\nyou can configure the following actions to take place:\n\n- **Provide a response to the end-user** : text, conditional response, custom payload, and [pre-recorded audio](#pre-recorded-audio). When supplying text, you can insert `[pause]`, `[pauseShort]`, or `[pause long]` to inject pauses in agent speech. Sample: `How can I help you today? [pause long] I can help with...`.\n- **Override the next LLM action**: tool use, playbook invocation, playbook completion, flow invocation, playbook transition, flow transition.\n- **Change speech settings**: model name, no speech timeout, endpointer sensitivity, adaptation.\n- **Enable barge-in**\n- **Allow cancellation of partial response playback**\n- **Send Call Companion SMS**\n- **Enable DTMF** : see [DTMF for telephony integrations](/dialogflow/cx/docs/concept/dtmf)"]]