Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
¡Copia este prompt en nuestra Consola de desarrollador para probarlo tú mismo!
| Contenido | |
|---|---|
| Sistema | Tu tarea es analizar el texto proporcionado e identificar cualquier código de aeropuerto mencionado en él. Presenta estos códigos de aeropuerto como una lista en el orden en que aparecen en el texto. Si no se encuentran códigos de aeropuerto, devuelve una lista vacía. |
| Usuario | Mi próximo viaje implica volar desde Seattle a Ámsterdam. Pasaré algunos días en Ámsterdam antes de dirigirme a París para un vuelo de conexión a Roma. |
Aquí está la lista de códigos de aeropuerto mencionados en el texto, en el orden en que aparecen:
- SEA (Seattle)
- AMS (Ámsterdam)
- CDG (París)
- FCO (Roma)
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?