Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
将此提示复制到我们的开发者控制台中亲自试用!
| 内容 | |
|---|---|
| 系统 | 您的任务是分析提供的文本并识别其中提到的任何机场代码。按照它们在文本中出现的顺序,将这些机场代码以列表形式呈现。如果未找到机场代码,则返回一个空列表。 |
| 用户 | 我的下一次旅行将从西雅图飞往阿姆斯特丹。我将在阿姆斯特丹待几天,然后前往巴黎转机飞往罗马。 |
以下是文本中提到的机场代码列表,按出现顺序排列:
- SEA(西雅图)
- AMS(阿姆斯特丹)
- CDG(巴黎)
- FCO(罗马)
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-6",
max_tokens=1000,
temperature=0,
system="Your task is to analyze the provided text and identify any airport codes mentioned within it. Present these airport codes as a list in the order they appear in the text. If no airport codes are found, return an empty list.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "My next trip involves flying from Seattle to Amsterdam. I'll be spending a few days in Amsterdam before heading to Paris for a connecting flight to Rome."
}
]
}
]
)
print(message.content)
Was this page helpful?