Anthropic 开发者控制台新增提示词生成器
Generate better prompts in the developer console | Claude by Anthropic
Anthropic 在开发者控制台推出提示词生成器,用户描述任务后 Claude 会运用角色设定、链式推理等技巧生成可编辑的提示词模板。该功能基于一个长提示词实现,并支持将模板变量用于评估,ZoomInfo 称其将提示词优化时间减少了 80%。
推荐理由
AI 评分 52
原文给出了提示词生成器的具体用法和最佳实践,开发者可以据此快速产出可编辑的提示词模板。
主题
正文
当前显示原文,中文全文译文尚未就绪。
Claude now generates production-ready prompt templates, helping developers create effective prompts faster.
You can now generate production-ready prompt templates in the Anthropic Console. Describe what you want to achieve, and Claude will use prompt engineering techniques such as chain-of-thought reasoning to create an effective, precise, and reliable prompt.
This feature is designed to help users who are new to prompt engineering, as well as save time for experienced prompt engineers. You will get the best results by providing the prompt generator with detailed information about your task and desired output formatting.
Although the generated prompts do not always produce perfect results, they often outperform hand-written prompts created by those who are new to prompt engineering. The generated prompt templates are also editable, allowing you to quickly tweak them for optimal performance.
Prompting best practices
The prompt templates generated by this new feature make use of many of our prompt engineering best practices. One such practice is role setting, where Claude is encouraged to take on the characteristics of an expert at the chosen task. In our content moderation example, the role setting looks like this:
Another practice is chain of thought reasoning, in which Claude is given time and space to collect its thoughts before answering. This allows for more thorough and well-reasoned responses to complex queries. When asked to generate a prompt for product recommendations based on a customer's previous transactions, this is implemented as follows:
Additionally, the templates often place the “variables”—input fields where custom data can be inserted—between XML tags. This follows another key best practice by clearly delineating different parts of the prompt by providing a clear structure. When asked for a prompt that translates code to Python, we see that the longer and more ambiguous {{CODE}} variable is marked by XML tags, while the simple {{LANGUAGE}} variable is positioned inline.
In some cases, you’ll see Claude writing example inputs and outputs to give itself clear direction around the types of answers it thinks you want. You can edit these examples to match your desired output formatting.
Behind the scenes
The prompt generator is based on a long prompt that itself uses many of the techniques already mentioned.
It contains numerous examples of task descriptions and prompt templates to show Claude how to go from a task description to a prompt template; It encourages Claude to plan out the structure of the template it will produce before writing that template, allowing Claude time to collect its thoughts; It has a strong “spine” composed of XML tags that mark the beginning and end of each section to enhance legibility
You can see the full prompt in this Colab notebook.
Prompt templates as an evaluation tool
Variables in the templates you’ll get from the prompt generator will be in handlebars notation, as shown in the earlier content moderation example:
Unknown block type "codeBlock", specify a component for it in the `components.types` option
In this example, you could then upload your content policy and a range of different chat transcripts to see how Claude behaves. This process allows you to ensure that your application will respond appropriately across a variety of situations.
Customer spotlight: ZoomInfo
Go-to-market platform ZoomInfo uses Claude to make actionable recommendations and drive value for their customers. Their use of prompt generation helped significantly reduce the time it took to build an MVP of their RAG application, all while improving output quality.
“Anthropic’s new prompt generator feature enabled us to reach production-ready outputs much faster. It highlighted techniques I hadn't been using to boost performance, and significantly reduced the time spent tuning our app," said Spencer Fox, Principal Data Scientist at ZoomInfo. "We built a new RAG application and reached MVP in just a few days, reducing the time it took to refine prompts by 80%.”
Related articles
Explore more product news and best practices for teams building with Claude.
Build live dashboards and animate explainers with Claude
Claude Dashboards and Claude Motion are now in beta. Docs, Slides, and Design are out of beta and on every Claude plan, including Free.
Claude Haiku 5.5
Introducing Claude Haiku 5.5: the cheapest, fastest, and most capable small model we’ve ever released.
Claude now works with Google Docs, Sheets, and Slides
Teams that run on Google Workspace can now bring Claude into their files or work on their files directly from Claude, with our new add-on and Google Docs, Sheets, and Slides connectors (in beta).
We’re expanding the Claude Startups program to help founders build