프롬프트 생성
잘 작성된 프롬프트 생성
프롬프트 도구 API는 비공개 연구 미리보기 단계에 있습니다. 비공개 연구 미리보기 참여 요청.
시작하기 전에
프롬프트 도구는 프롬프트를 생성하고 개선하는 API 세트입니다. 다른 API와 달리, 이것은 실험적 API입니다: 액세스를 요청해야 하며, 다른 API와 같은 수준의 장기 지원 약속이 없습니다.
이러한 API는 Anthropic Workbench에서 사용할 수 있는 것과 유사하며, 다른 프롬프트 엔지니어링 플랫폼과 플레이그라운드에서 사용하기 위한 것입니다.
프롬프트 생성기 시작하기
프롬프트 생성 API를 사용하려면 다음이 필요합니다:
- 프롬프트 도구 API의 비공개 연구 미리보기에 참여했을 것
- SDK가 아닌 API를 직접 사용할 것
- 베타 헤더
prompt-tools-2025-04-02
추가
이 API는 SDK에서 사용할 수 없습니다
프롬프트 생성
Headers
Optional header to specify the beta version(s) you want to use.
To use multiple betas, use a comma separated list like beta1,beta2
or specify the header multiple times for each beta.
Body
Description of the prompt's purpose.
The task
parameter tells Claude what the prompt should do or what kind of role or functionality you want to create. This helps guide the prompt generation process toward your intended use case.
Example:
{"task": "a chef for a meal prep planning service"}
"a chef for a meal prep planning service"
The model this prompt will be used for. This optional parameter helps us understand which models our prompt tools are being used with, but it doesn't currently affect functionality.
Example:
"claude-3-7-sonnet-20250219"
1 - 256
"claude-3-7-sonnet-20250219"
Response
The response contains a list of message objects in the same format used by the Messages API. Typically includes a user message with the complete generated prompt text, and may include an assistant message with a prefill to guide the model's initial response.
These messages can be used directly in a Messages API request to start a conversation with the generated prompt.
Example:
{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "You are a chef for a meal prep planning service..."
}
]
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": "<recipe_planning>"
}
]
}
]
}
[
{
"content": [
{
"text": "<generated prompt>",
"type": "text"
}
],
"role": "user"
}
]
Currently, the system
field is always returned as an empty string (""). In future iterations, this field may contain generated system prompts.
Directions similar to what would normally be included in a system prompt are included in messages
when generating a prompt.
""
Usage information