5 ms·
Bits of this tutorial feel a little bit out-dated. The appendix on function calling for example - https://github.com/anthropics/courses/blob/master/prompt_engin
by simonw 2y ago
Bits of this tutorial feel a little bit out-dated. The appendix on function calling for example - https://github.com/anthropics/courses/blob/master/prompt_engineering_interactive_tutorial/Anthropic%201P/10.2_Appendix_Tool%20Use.ipynb https://github.com/anthropics/courses/blob/master/prompt_eng... - shows how to implement function calling from scratch using XML-style tags - but Claude's API has had JSON schema-based function calling for a few months now: https://docs.anthropic.com/en/docs/build-with-claude/tool-use https://docs.anthropic.com/en/docs/build-with-claude/tool-us...
Oh, never mind - they have an entire separate course about tool use via the API here: https://github.com/anthropics/courses/blob/master/tool_use/01_tool_use_overview.ipynb https://github.com/anthropics/courses/blob/master/tool_use/0...
So they're using tools in that appendix purely to demonstrate how sophisticated you can get with raw prompting.
- minimaxir 2y agoThe documentation still advocates using XML tags as a subset of prompt engineering despite the push for JSON-based structured I/O, confusingly: https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags https://docs.anthropic.com/en/docs/build-with-claude/prompt-... The structured output tutorial uses the XML tags to wrap user input instead of using system prompt engineering and then passing the user input as-is (IMO system prompt engineering is still better since it adds more control levers): https://github.com/anthropics/courses/blob/master/tool_use/03_structured_outputs.ipynb https://github.com/anthropics/courses/blob/master/tool_use/0...
- thelittleone 2y agoPersonally, I prefer XML over JSON for prompts from a readability perspective.
- tcdent 2y agoI saw a talk recently from one of their prompt engineers where he encouraged XML-style tag use as well. Supported by the training datasets they use.
- scottmf 2y agoWas this in person or do you have a link by any chance? Would love to see it. From my own experience XML tags are incredibly powerful — particularly for very large system prompts, with some markdown in there too.
- simonw 2y agoI ran through the whole tutorial and published some notes on tips I picked up from it here: https://simonwillison.net/2024/Aug/30/anthropic-prompt-engineering-interactive-tutorial/ https://simonwillison.net/2024/Aug/30/anthropic-prompt-engin...
- deleted 2y ago[deleted]