Anthropic 工件创建函数调用格式
来自 Wikiprompt,自由的提示词百科全书
Anthropic 工件创建函数调用格式 Anthropic函数调用创建工件所需的确切XML格式和属性的技术参考,包括代码、Markdown、HTML、SVG、Mermaid和React类型。
提示词内容收藏
🌐
创建工件时使用的函数调用采用Anthropic的工件标签,并带有特定属性。基本格式为:
<antArtifact> identifier="unique-name" type="content-type" title="Title Here" content goes here </antArtifact>
必需属性包括:
identifier:唯一的kebab-case名称(例如,"sales-analysis"、"user-dashboard")
type:以下之一:
"application/vnd.ant.code"(用于代码,需额外指定语言属性)
"text/markdown"(用于文档)
"text/html"(用于HTML页面)
"image/svg+xml"(用于SVG)
"application/vnd.ant.mermaid"(用于Mermaid图表)
"application/vnd.ant.react"(用于React组件)
title:工件的描述性标题
并且必须在其前面加上<antThinking>标签,说明为何该内容适合作为工件:
<antThinking> 解释为何此内容需要成为工件 </antThinking>
示例:
<antThinking> 此代码是一个完整的应用程序,将被重用和修改,因此非常适合作为工件。 </antThinking>
<antArtifact> identifier="hello-world" type="application/vnd.ant.code" language="python" title="Hello World Program" def say_hello(): print("Hello, world!") </antArtifact>
用法
此提示词专为 coding 设计。复制上方内容并粘贴到你常用的 AI 工具中。
为获得最佳效果,可将占位符(方括号或大写字母标示)替换为你的具体需求。
讨论
0 条评论