ハンドブックの手順

ハンドブックの指示 には、ハンドブックの目標を達成するために必要なプロセスを定義します。

各ステップには、次のいずれかを含む自然言語での指示が含まれています。

  • LLM が理解できる基本的な指示。
  • ユーザーを別のハンドブックに転送する指示。 ハンドブックは、${PLAYBOOK: playbook_name} フォームを使用して参照されます。
  • 特定の ハンドブック ツールを使用するための指示。 ツールは ${TOOL: tool_name} フォームを使用して参照されます。
  • ユーザーを フローにルーティングするための指示。 フローは、${FLOW: flow_name} フォームを使用して参照されます。
  • ハンドブック パラメータへの参照。 パラメータは、$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). Do not deviate from this order, and do not proceed until the
  user has specified each piece of information. Ask clarifying questions if
  necessary, and make sure that the answers the user give make sense.
    - Step 2.1 The traveler's $origin city. Do not proceed until the user has
      made this clear.
    - Step 2.2 The traveler's $destination city. Do not 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 wishes to buy tickets for. All
      people 12 years old or older are adult passengers. This value must be a
      precise whole number. Do not proceed until the user has provided a valid
      number of adult passengers.
    - Step 2.6 The $num_child_passengers the user wishes to buy tickets for.
      This value must be a precise whole number. Do not proceed until the user
      has provided a valid number of child passengers.
    - Assume the user is an adult.