Multiple Choice and Classification
You can ask Claude to classify inputs as follows.
Future development
We will probably offer a simpler “multiple choice endpoint” in the future.
Claude is a conversational agent, so often it will explain at length why it selected a given option. If you just want a fast multiple-choice answer and no explanation, you can use the "Human:
"/"Assistant:
" formatting in the API to put words in Claude's mouth and have Claude respond in a particular way.
For example, if the available options start with (
, you can end your prompt with "Assistant: My answer is (
". That way you can immediately get a response in the first token.
Human: You are a customer service agent that is classifying emails by type.
Email:
<email>
Hi -- My Mixmaster4000 is producing a strange noise when I operate it. It also smells a bit smoky and plasticky, like burning electronics. I need a replacement.
</email>
Categories are:
(A) Pre-sale question
(B) Broken or defective item
(C) Billing question
(D) Other (please explain)
Assistant: My answer is (
B) Broken or defective item
Updated 4 months ago