應對手冊操作說明

Playbook 操作說明定義了達成 Playbook 目標的程序。

每個步驟都包含自然語言指示,其中可能包含下列任一內容:

  • 您可以為 LLM 編寫基本指令,讓 LLM 理解。
  • 將使用者轉送至其他緊急操作手冊的指示,格式為 ${PLAYBOOK: playbook_name}。
  • 指示使用特定教戰手冊工具,並以 ${TOOL: tool_name} 格式參照工具。
  • 將使用者轉送至流程的指令,使用 ${FLOW: flow_name} 格式參照流程。
  • Playbook 參數的參照,使用 $parameter_name 格式參照參數。
  • 呼叫程式碼區塊的指令,使用 `function_name` 格式參照程式碼區塊。

每個步驟說明都以 - 和選用的編號步驟開頭,您可以使用縮排定義子操作說明。

範例:

- greet the customer and ask them how you can help.
    - If the customer wants to book flights, route them to ${PLAYBOOK: flight_booking}.
    - If the customer wants to book hotels, route them to  ${PLAYBOOK: hotel_booking}.
    - If the customer wants to know trending attractions, use the ${TOOL: attraction_tool} to show them the list.
- help the customer to pay for their booking by routing them to ${FLOW: make_payment}.

操作說明步驟

如要讓操作說明更有條理,可以選擇使用階層式編號系統定義步驟。如果未提供步驟編號,且程式碼區塊參照特定步驟,則步驟順序會決定步驟位置值。

範例:

- Step 1. Greet the user and ask how you can assist them today.
- Step 2. Collect the user's basic flight information in the following order
  from (a) to (f). Don't deviate from this order, and don't proceed until the
  user has specified each piece of information. Ask clarifying questions if
  necessary, and make sure that the answers the user gives make sense.
    - Step 2.1 The traveler's $origin city. Don't proceed until the user has
      made this clear.
    - Step 2.2 The traveler's $destination city. Don't proceed until the user
      has made this clear.
    - Step 2.3 When the traveler will leave their origin city. If the user
      specifies one departure date, collect their $earliest_departure_date. If
      the user specifies a range of departure dates, collect their
      $earliest_departure_date and $latest_departure_date. Unless otherwise
      specified, assume all dates are from 2024 to 2025. If the user provides
      a vague departure date, ask them follow-up questions to determine their
      precise departure date(s). All dates should be in YYYY-MM-DD format. If
      the user does not provide their departure date(s) in YYYY-MM-DD format,
      then convert the dates for them.
    - Step 2.4 When the traveler will leave from their destination city and
      return home. If the user specifies one return date, collect their
      $earliest_return_date. If the user specifies a range of return dates,
      collect their $earliest_return_date and $latest_return_date. Unless
      otherwise specified, assume all dates are from 2024 to 2025. If the user
      provides a vague return date or a vague return date range, ask them
      follow-up questions to determine their precise return date(s). All dates
      should be in YYYY-MM-DD format. If the user does not provide their return
      dates in YYYY-MM-DD format, then convert the dates for them.
    - Step 2.5 The $num_adult_passengers the user wants to buy tickets for. All
      people 12 years old or older are adult passengers. This value must be a
      precise whole number. Don't proceed until the user has provided a valid
      number of adult passengers.
    - Step 2.6 The $num_child_passengers the user wants to buy tickets for.
      This value must be a precise whole number. Don't proceed until the user
      has provided a valid number of child passengers.
    - Assume the user is an adult.