Claude API Role Alternation Errors and Fixes
When interacting with Claude via the Messages API, messages must strictly alternate between user and assistant roles, always starting with a user message, or the API will return an error. Consolidate consecutive user artifacts inside a single user turn using nested XML tags.
<user_inputs> <artifact index="1" type="error_log">{{LOG}}</artifact> <artifact index="2" type="config">{{CONFIG}}</artifact> </user_inputs> Analyze both artifacts above in this single user turn and identify the configuration mismatch.Fill in the blanks (2)
Nobody has confirmed this prompt yet. If you try it, tell others whether it worked.
No comments yet.