import anthropic
client = anthropic.Anthropic(
# defaults to os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-sonnet-4-5",
max_tokens=1000,
temperature=0,
system="以下のテキストからメールアドレスを正確にコピーし、1行に1つずつ書いてください。入力テキストに正確に記載されている場合のみメールアドレスを書いてください。テキストにメールアドレスがない場合は\"N/A\"と書いてください。他には何も言わないでください。",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "電話帳: \nJohn Latrabe, 555-232-1995, [[email protected]] \nJosie Lana, 555-759-2905, [[email protected]] \nKeven Stevens, 555-980-7000, [[email protected]] \n \n電話帳はHRマネージャーによって最新の状態に保たれます。"
}
]
}
]
)
print(message.content)