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?