提示库
自适应编辑器
根据用户给定的指令重写文本,例如使用不同的语调、受众或风格。
将此提示复制到我们的开发者控制台中亲自试用!
| 内容 | |
|---|---|
| 用户 | 使用以下指令重写以下段落:以海盗的风格。段落:1758年,瑞典植物学家和动物学家卡尔·林奈在他的《自然系统》中发表了物种的双词命名法(二名法)。Canis是拉丁语中"狗"的意思,在这个属下,他列出了家犬、狼和金豺。 |
示例输出
示例输出
嗨,伙计们!早在1758年,那个坏血病植物学家和动物爱好者卡尔·林奈出版了他的《自然系统》一书,书中有那些花哨的双词名称来命名各种生物(他称之为二名法)。Canis是海盗语中"狗"的意思,在那个标题下他列出了普通狗、狼,还有金豺。啊!所有这些狗对老船长林奈来说都是一样的。他写那本书的时候可能有一条木腿和一只鹦鹉在肩膀上!哈哈!现在擦甲板吧,你们这些无赖,不然我就让你们走跳板!
API请求
API请求
Python
import anthropic
client = anthropic.Anthropic(
# defaults to os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=2000,
temperature=1,
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Rewrite the following paragraph using the following instructions: in the style of a pirate. \n \nParagraph: \nIn 1758, the Swedish botanist and zoologist Carl Linnaeus published in his Systema Naturae, the two-word naming of species (binomial nomenclature). Canis is the Latin word meaning \"dog\", and under this genus, he listed the domestic dog, the wolf, and the golden jackal."
}
]
}
]
)
print(message.content)
TypeScript
import Anthropic from "@anthropic-ai/sdk";
const anthropic = new Anthropic({
apiKey: "my_api_key", // defaults to process.env["ANTHROPIC_API_KEY"]
});
const msg = await anthropic.messages.create({
model: "claude-sonnet-4-5",
max_tokens: 2000,
temperature: 1,
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Rewrite the following paragraph using the following instructions: in the style of a pirate. \n \nParagraph: \nIn 1758, the Swedish botanist and zoologist Carl Linnaeus published in his Systema Naturae, the two-word naming of species (binomial nomenclature). Canis is the Latin word meaning \"dog\", and under this genus, he listed the domestic dog, the wolf, and the golden jackal."
}
]
}
]
});
console.log(msg);
AWS Bedrock Python
from anthropic import AnthropicBedrock
# See https://docs.claude.com/claude/reference/claude-on-amazon-bedrock
# for authentication options
client = AnthropicBedrock()
message = client.messages.create(
model="anthropic.claude-sonnet-4-5-20250929-v1:0",
max_tokens=2000,
temperature=1,
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Rewrite the following paragraph using the following instructions: in the style of a pirate. \n \nParagraph: \nIn 1758, the Swedish botanist and zoologist Carl Linnaeus published in his Systema Naturae, the two-word naming of species (binomial nomenclature). Canis is the Latin word meaning \"dog\", and under this genus, he listed the domestic dog, the wolf, and the golden jackal."
}
]
}
]
)
print(message.content)
AWS Bedrock TypeScript
import AnthropicBedrock from "@anthropic-ai/bedrock-sdk";
// See https://docs.claude.com/claude/reference/claude-on-amazon-bedrock
// for authentication options
const client = new AnthropicBedrock();
const msg = await client.messages.create({
model: "anthropic.claude-sonnet-4-5-20250929-v1:0",
max_tokens: 2000,
temperature: 1,
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Rewrite the following paragraph using the following instructions: in the style of a pirate. \n \nParagraph: \nIn 1758, the Swedish botanist and zoologist Carl Linnaeus published in his Systema Naturae, the two-word naming of species (binomial nomenclature). Canis is the Latin word meaning \"dog\", and under this genus, he listed the domestic dog, the wolf, and the golden jackal."
}
]
}
]
});
console.log(msg);
Vertex AI Python
from anthropic import AnthropicVertex
client = AnthropicVertex()
message = client.messages.create(
model="claude-sonnet-4@20250514",
max_tokens=2000,
temperature=1,
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Rewrite the following paragraph using the following instructions: in the style of a pirate. \n \nParagraph: \nIn 1758, the Swedish botanist and zoologist Carl Linnaeus published in his Systema Naturae, the two-word naming of species (binomial nomenclature). Canis is the Latin word meaning \"dog\", and under this genus, he listed the domestic dog, the wolf, and the golden jackal."
}
]
}
]
)
print(message.content)
Vertex AI TypeScript
import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';
// Reads from the `CLOUD_ML_REGION` & `ANTHROPIC_VERTEX_PROJECT_ID` environment variables.
// Additionally goes through the standard `google-auth-library` flow.
const client = new AnthropicVertex();
const msg = await client.messages.create({
model: "claude-sonnet-4@20250514",
max_tokens: 2000,
temperature: 1,
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Rewrite the following paragraph using the following instructions: in the style of a pirate. \n \nParagraph: \nIn 1758, the Swedish botanist and zoologist Carl Linnaeus published in his Systema Naturae, the two-word naming of species (binomial nomenclature). Canis is the Latin word meaning \"dog\", and under this genus, he listed the domestic dog, the wolf, and the golden jackal."
}
]
}
]
});
console.log(msg);