anthropics / prompt-eng-interactive-tutorial

Anthropic's Interactive Prompt Engineering Tutorial
887 stars 149 forks source link

Notebook 05 | Missing opening XML tag "<haiku> in Claude's response #14

Closed michellepace closed 3 months ago

michellepace commented 3 months ago

Hello there.

I am not 100% sure if this is a mistake or if my understanding is not correct. When I run Notebook 5, I expected to see both the opening and closing XML tags in the output as I have in other examples. But Claude replies with only the closing tag </haiku> as shown in the screenshot below.

I am using MODEL_NAME = "claude-3-5-sonnet-20240620"

Doesn't work

image

Works

image

In example Doesn't Work, is this an error in Claude's response given the prefilling technique, or is it working as expected?

Super tutorial, thank you. Michelle

michellepace commented 3 months ago

Apologies, I see how it works now. The examples here https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/prefill-claudes-response#example-maintaining-character-without-role-prompting show exactly the same.