Playbook 说明

手册说明定义了实现 playbook 目标应采取的流程。

每个步骤都包含一条自然语言指令,指令可能包含以下内容:

  • LLM 可以理解的基本指令。
  • 用于将用户路由到其他 playbook 的说明。 playbook 是使用 ${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). 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.