Anthropic Artifact Creation Function Call Format
From Wikiprompt, the free prompt encyclopedia
Anthropic Artifact Creation Function Call Format A technical reference for the exact XML format and attributes needed to create artifacts via Anthropic's function call, including code, markdown, HTML, SVG, Mermaid, and React types.
Prompt ContentSave
π
The function call for creating an artifact uses Anthropic's artifact tags with specific attributes. The basic format is:
<antArtifact> identifier="unique-name" type="content-type" title="Title Here" content goes here </antArtifact>
The required attributes are:
identifier: A unique kebab-case name (e.g., "sales-analysis", "user-dashboard")
type: One of:
"application/vnd.ant.code" (for code, needs additional language attribute)
"text/markdown" (for documents)
"text/html" (for HTML pages)
"image/svg+xml" (for SVGs)
"application/vnd.ant.mermaid" (for Mermaid diagrams)
"application/vnd.ant.react" (for React components)
title: A descriptive title for the artifact
And you must precede it with an <antThinking> tag explaining why it warrants being an artifact:
<antThinking> Explanation of why this needs to be an artifact </antThinking>
Example:
<antThinking> This code is a complete application that will be reused and modified, making it ideal for an artifact. </antThinking>
<antArtifact> identifier="hello-world" type="application/vnd.ant.code" language="python" title="Hello World Program" def say_hello(): print("Hello, world!") </antArtifact>
Sign in to see the full prompt
Continue with:
By logging in, you agree to our Terms of Use and Privacy Policy
Usage
This prompt is designed for use with coding. Copy the prompt content above and paste it into your preferred AI tool.
For best results, you may customize the placeholders (indicated by square brackets or capital letters) with your specific requirements.
References
- Category: coding Prompts
- Source: https://x.com/elder_plinius/status/1849075270054994075
Talk
0 comments