
Answer-first summary for fast verification
Answer: You will receive customer emails and need to extract date, sender email, and order ID. Return the extracted information in JSON format. Here’s an example: {“date”: “April 16, 2024”, “sender_email”: “sarah.lee925@gmail.com”, “order_id”: “RE987D”}
Option B is the optimal choice because it clearly specifies the required JSON output format and provides a concrete example that demonstrates the exact structure and field names expected. This example serves as a strong guide for the LLM, reducing ambiguity and increasing output accuracy. Option A also requests JSON format but lacks an example, making it less precise. Option C explicitly requests human-readable format instead of JSON, which contradicts the requirement. Option D contains a typo ('order IReturn') that could confuse the LLM and reduce accuracy. The community discussion shows support for B, with comments noting that the example output improves performance, and B has the second-highest community vote percentage (33%) despite A having more votes (67%), suggesting B is recognized for its superior clarity and example-based guidance.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A Generative AI engineer needs to create a prompt for an LLM to parse emails and extract the order ID, date, and sender email into formatted JSON. Given the following sample email, which prompt will achieve the highest output accuracy?
Dear Customer,
Your order #A12345 has been confirmed. It was placed on 2023-10-05. Please contact us at support@example.com if you have any questions.
Best Regards,
The Store Team
Dear Customer,
Your order #A12345 has been confirmed. It was placed on 2023-10-05. Please contact us at support@example.com if you have any questions.
Best Regards,
The Store Team

A
You will receive customer emails and need to extract date, sender email, and order ID. You should return the date, sender email, and order ID information in JSON format.
B
You will receive customer emails and need to extract date, sender email, and order ID. Return the extracted information in JSON format. Here’s an example: {“date”: “April 16, 2024”, “sender_email”: “sarah.lee925@gmail.com”, “order_id”: “RE987D”}
C
You will receive customer emails and need to extract date, sender email, and order ID. Return the extracted information in a human-readable format.
D
You will receive customer emails and need to extract date, sender email, and order IReturn the extracted information in JSON format.