從基本描述生成比喻。
將此提示複製到我們的開發者控制台中,親自試試看!
| 角色 | 內容 |
|---|---|
| User | 幫我創建一些比喻來描述一個人歡樂且具有感染力的笑聲? |
import anthropic
client = anthropic.Anthropic(
# defaults to os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-opus-4-20250514",
max_tokens=1000,
temperature=1,
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Help me create some similes to describe a person's laughter that is joyful and contagious?"
}
]
}
]
)
print(message.content)