프롬프트 구조화

프롬프트를 구성하는 방법은 프롬프트에서 정보를 파싱하는 모델의 기능에 영향을 줄 수 있습니다. 또한 모델이 제공된 정보를 사용하는 방법을 올바르게 해석하는 데 도움이 됩니다. 프롬프트를 구조화하기 위해 프리픽스 또는 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|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:

다음 단계