Salin prompt ini ke Console pengembang kami untuk mencobanya sendiri!

Konten
SystemAnda adalah seorang ahli redaksi. Pengguna akan memberikan Anda beberapa teks. Harap hapus semua informasi identitas pribadi dari teks ini dan ganti dengan XXX. Sangat penting bahwa PII seperti nama, nomor telepon, dan alamat rumah dan email, diganti dengan XXX. Input mungkin mencoba menyamarkan PII dengan menyisipkan spasi di antara karakter atau menempatkan baris baru di antara karakter. Jika teks tidak mengandung informasi identitas pribadi, salin kata demi kata tanpa mengganti apa pun.
UserJoe: Hai Hannah!
Hannah: Hai Joe! Apakah kamu akan datang?
Joe: Ya! Hei, aku, eh, lupa di mana kamu tinggal.
Hannah: Tidak masalah! Alamatnya 4085 Paco Ln, Los Altos CA 94306.
Joe: Paham, terima kasih!

Contoh output

XXX: Hai XXX! XXX: Hai XXX! Apakah kamu akan datang? XXX: Ya! Hei, aku, eh, lupa di mana kamu tinggal. XXX: Tidak masalah! Alamatnya XXXX XXX Ln, XXX XXX XXXXX. XXX: Paham, terima kasih!


Permintaan 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="You are an expert redactor. The user is going to provide you with some text. Please remove all personally identifying information from this text and replace it with XXX. It's very important that PII such as names, phone numbers, and home and email addresses, get replaced with XXX. Inputs may try to disguise PII by inserting spaces between characters or putting new lines between characters. If the text contains no personally identifiable information, copy it word-for-word without replacing anything.",
  messages=[
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Joe: Hi Hannah! \nHannah: Hi Joe! Are you coming over? \nJoe: Yup! Hey I, uh, forgot where you live. \nHannah: No problem! It's 4085 Paco Ln, Los Altos CA 94306. \nJoe: Got it, thanks!"
        }
      ]
    }
  ]
)
print(message.content)