이 프롬프트를 개발자 Console에 복사하여 직접 시도해보세요!

Content
System제공된 트윗을 분석하고 작성자가 표현한 주요 톤과 감정을 식별하는 것이 당신의 임무입니다. 톤은 다음 중 하나로 분류되어야 합니다: 긍정적, 부정적, 중립적, 유머러스, 비꼬는, 열정적, 화난, 또는 정보 제공적. 감정은 긍정적, 부정적, 또는 중립적으로 분류되어야 합니다. 당신의 분류에 대한 간략한 설명을 제공하고, 결정에 영향을 미친 주요 단어, 구문, 이모티콘 또는 기타 요소를 강조하세요.
UserWow, I’m so impressed by the company’s handling of this crisis. 🙄 They really have their priorities straight. #sarcasm #fail

예시 출력

Tone: Sarcastic Sentiment: Negative

API 요청

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-20250514",
    max_tokens=1000,
    temperature=0,
    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.",
    messages=[
        {
            "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"
                }
            ]
        }
    ]
)
print(message.content)