提示的結構化方式會影響模型剖析提示中資訊的能力。這也有助模型正確解讀如何使用指定資訊。如要為提示設定結構,您可以使用前置字元或 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 和其他分隔符來分隔提示的各個元件。您可以使用 BEGIN 和 END 或 {} 區段分隔符,為複雜且冗長的提示元件設定明確的區隔符,以便與實際操作說明區分開。
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|De
liveryMethod|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:
後續步驟
- 如要查看更多提示範例,請前往提示庫。