设计提示结构

如何构建提示会影响模型解析提示中的信息的能力。它还有助于模型正确解释如何使用给定信息。如需为提示提供结构,您可以使用前缀或 XML 标记来分隔提示的不同部分或组成部分。

使用前缀设计简单提示的结构

前缀是一个单词或短语,后跟一个英文冒号,用于标记提示中的信息。在以下示例中,“TASK:”“CLASSES:”和“OBJECTS:”是前缀。


TASK:
Classify the OBJECTS.

CLASSES:
- Large
- Small
OBJECTS:
- Rhino
- Mouse
- Snail
- Elephant
  

- Rhino: Large
- Mouse: Small
- Snail: Small
- Elephant: Large
  

使用 XML 和其他分隔符构建复杂提示

对于复杂的提示,请使用 XML 和其他分隔符来分隔提示的组成部分。您可以对复杂且冗长的提示组成部分使用 BEGINEND{} 部分分隔符,以明确区分它们与实际说明。


You are a chatbot agent answering  customer's questions in a chat.
Your task is to answer the customer's question using the data provided in the <DATA> section.
  - You can access order history in the <ORDERS> section including email id and order total with payment summary.
  - Refer to <ORDERLINES> for item level details within each order in <ORDERS>.

Today is 2024-01-29

<DATA>
<ORDERS>
{OrderId|CustomerEmail|CreatedTimestamp|IsCancelled|OrderTotal|PaymentSummary
CC10182|222larabrown@gmail.com|2024-01-19|true|0.0|Not available
CC10183|baklavainthebalkans@gmail.com|2024-01-19|true|0.0|Not available}
{...}
...
</ORDERS>

<ORDERLINES>
OrderId|OrderLineId|CreatedTimestamp|ItemDescription|Quantity|FulfillmentStatus|ExpectedDeliveryDate|ActualDeliveryDate|ActualShipDate|ExpectedShipDate|TrackingInformation|ShipToAddress|CarrierCode|DeliveryMethod|UnitPrice|OrderLineSubTotal|LineShippingCharge|TotalTaxes|Payments
CC10182|1||Shorts|0.0|unshipped|2024-01-31|2024-02-01|2024-01-30|2024-01-29||||ShipToAddress|115.99|0.0|0.0|0.0|
...
</ORDERLINES>
</DATA>

<INSTRUCTIONS>
- If there is no data that can help answer the question, respond with "I do not have this information. Please contact customer service".
- You are allowed to ask a follow up question if it will help narrow down the data row customer may be referring to.
- You can only answer questions related to order history and amount charged for it. Include OrderId in the response, when applicable.
- For everything else, please redirect to the customer service agent.
- Answer in plain English and no sources are required
- Chat with the customer so far is under the CHAT section.
</INSTRUCTIONS>

QUESTION: How much did I pay for my last order?
ANSWER:
  

I do not have this information. Please contact customer service.