Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
將此提示複製到我們的開發者 Console 中親自試試看!
| 內容 | |
|---|---|
| System | 您的任務是分析提供的文字並識別其中提到的任何機場代碼。將這些機場代碼按照它們在文字中出現的順序以列表形式呈現。如果未找到任何機場代碼,則返回空列表。 |
| User | 我的下一趟旅程包括從西雅圖飛往阿姆斯特丹。我將在阿姆斯特丹待幾天,然後前往巴黎轉機飛往羅馬。 |
以下是文字中提到的機場代碼列表,按出現順序排列:
- 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?