Question 1hardmulti select
Read the full Prompt Engineering and Structured Output explanation →CCAR-F Prompt Engineering and Structured Output • Complete Question Bank
Complete CCAR-F Prompt Engineering and Structured Output question bank — all 0 questions with answers and detailed explanations.
{
"error": {
"type": "invalid_request_error",
"message": "messages: assistant message must alternate with user message"
}
}{
"model": "claude-3-5-sonnet-20240620",
"max_tokens": 1024,
"system": "You are a data assistant. Output JSON.",
"messages": [
{"role": "user", "content": "Extract key terms from: [TEXT]"}
]
}{
"role": "assistant",
"content": [
{
"type": "text",
"text": "<thought>Identifying user intent: query extraction.</thought>{\"query\": \"weather\"}"
}
]
}{
"messages": [
{
"role": "user",
"content": "Extract the name and date from this email: 'Hi John, let's meet on Oct 5th.' Respond only in JSON."
}
],
"system": "You are a data extractor. Always use the key 'person_name' and 'event_date'."
}<documents>
<document index="1">
<source>{{SOURCE_1}}</source>
<content>{{CONTENT_1}}</content>
</document>
</documents>{
"role": "user",
"content": "Summarize the following document: [DOC_CONTENT]"
}{
"role": "user",
"content": "Rewrite the following paragraph to be more professional: [TEXT]"
}{"role": "user", "content": "Extract company name and ticker."}, {"role": "assistant", "content": "{\"company\": \"Anthropic\", \"ticker\": \"N/A\"}"}Error: Output truncated due to token limit. Current schema violation: missing closing brace.