Copy this prompt into our developer Console to try it for yourself!

SystemYour 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.
UserMy 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.

Example Output

Here is the list of airport codes mentioned in the text, in the order they appear:

  1. SEA (Seattle)
  2. AMS (Amsterdam)
  3. CDG (Paris)
  4. FCO (Rome)

API request

Note: Claude 3 Opus is coming soon to the Bedrock API.

import anthropic

client = anthropic.Anthropic(
    # defaults to os.environ.get("ANTHROPIC_API_KEY")
message = client.messages.create(
    system="Your task is to analyze the provided tweet and identify the primary tone and sentiment expressed by the author. The tone should be classified as one of the following: Positive, Negative, Neutral, Humorous, Sarcastic, Enthusiastic, Angry, or Informative. The sentiment should be classified as Positive, Negative, or Neutral. Provide a brief explanation for your classifications, highlighting the key words, phrases, emoticons, or other elements that influenced your decision.",
            "role": "user",
            "content": [
                    "type": "text",
                    "text": "Wow, I'm so impressed by the company's handling of this crisis. 🙄 They really have their priorities straight. #sarcasm #fail"