Back
Airport code analyst
Find and extract airport codes from text.
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.
user
My next trip involves flying from Seattle-Tacoma International Airport to Amsterdam Airport Schiphol (AMS). I'll be spending a few days in Amsterdam before heading to Paris Charles de Gaulle Airport (CDG) for a connecting flight to Rome-Fiumicino International Airport (FCO).
Based on the airports mentioned in the text, the list of airport codes in the order they appear is:
SEA, AMS, CDG, FCO
API request
pythonimport anthropic client = anthropic.Anthropic( # defaults to os.environ.get("ANTHROPIC_API_KEY") api_key="my_api_key", ) message = client.messages.create( model="claude-3-opus-20240229", max_tokens=2000, 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":"My next trip involves flying from Seattle-Tacoma International Airport to Amsterdam Airport Schiphol (AMS). I'll be spending a few days in Amsterdam before heading to Paris Charles de Gaulle Airport (CDG) for a connecting flight to Rome-Fiumicino International Airport (FCO)."}] ) print(message.content)