
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 C is optimal because it uses one-shot prompting by providing a clear example of the expected JSON output format. This approach significantly improves output accuracy by giving the LLM a concrete template to follow, reducing ambiguity and formatting errors. The community discussion strongly supports this with 80% choosing C and comments emphasizing that one-shot/few-shot prompting yields the highest accuracy. Option B only specifies JSON format without an example, which is less precise. Option A requests human-readable format instead of JSON, and Option D is incomplete and unclear.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A Generative AI Engineer needs to extract the date, sender email, and order ID from an email and output the information as JSON. Given the following email sample, which prompt will achieve the highest output accuracy?
//IMG//
//IMG//

A
You will receive customer emails and need to extract date, sender email, and order ID. Return the extracted information in a human-readable format.
B
You will receive customer emails and need to extract date, sender email, and order ID. Return the extracted information in JSON format.
C
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"}
D
You will receive customer emails and need to extract date, sender email, and order IYou should return the date, sender email, and order ID information in JSON format.