QuestionQ8

Application Development

A Generative AI Engineer wants an LLM to parse and extract the following information: date, sender email, and order ID. The output must be formatted as JSON. Here is a sample email:

Question Image

They need a prompt that extracts and returns the required information in JSON with the highest level of output accuracy.

Which prompt accomplishes this?

  • 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":"[email protected]", "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.
Explanation

Providing a clear JSON-output instruction together with an example of the expected fields and values gives the model a concrete output pattern to follow. This few-shot example improves extraction consistency and schema adherence compared with an instruction that only requests JSON.

Community Discussion

No comments yet. Be the first to start the discussion!