nerdexam
Salesforce

AI-201 · Question #237

An Agentforce Specialist needs to create a prompt template that extracts the customer's name, phone number, and case number from a block of text, and nothing else. How should the Agentforce…

The correct answer is B. Use well-defined output instructions and provide desired output examples. Prompt engineering best practice for structured extraction is to combine clear output format instructions with few-shot examples (showing the LLM exactly what the desired output looks like). Examples are especially powerful because they anchor the model's response format…

AI Features for Service (e.g., Einstein Bots, Next Best Action)

Question

An Agentforce Specialist needs to create a prompt template that extracts the customer's name, phone number, and case number from a block of text, and nothing else. How should the Agentforce Specialist structure the prompt to ensure the large language model (LLM) doesn't include extra conversation or text?

Options

  • AAsk the LLM to extract and only output the important information in the text.
  • BUse well-defined output instructions and provide desired output examples.
  • CEnsure in the prompt that the LLM has been told to only use name value pairs in the response.

How the community answered

(27 responses)
  • A
    11% (3)
  • B
    81% (22)
  • C
    7% (2)

Explanation

Prompt engineering best practice for structured extraction is to combine clear output format instructions with few-shot examples (showing the LLM exactly what the desired output looks like). Examples are especially powerful because they anchor the model's response format precisely, reducing hallucination and conversational filler. Option A ('only output the important information') is too vague and the LLM may still add preamble. Option C (forcing name-value pairs) is overly prescriptive about format but doesn't address preventing extra text as effectively as pairing instructions with examples.

Topics

#Prompt engineering#LLM output control#Information extraction#Prompt templates

Community Discussion

No community discussion yet for this question.

Full AI-201 Practice