Membuat konten baru

Pengantar Model Claude

Nikhil Rangarajan

Data Scientist

Pembuatan konten kreatif

  • Melampaui transformasi teks menjadi kreasi asli
    • Cerita

Sebuah buku terbuka

Pengantar Model Claude

Pembuatan konten kreatif

  • Melampaui transformasi teks menjadi kreasi asli
    • Cerita
    • Teks pemasaran

Sebuah buku terbuka dan halaman web menampilkan teks pemasaran

Pengantar Model Claude

Pembuatan konten kreatif

  • Melampaui transformasi teks menjadi kreasi asli
    • Cerita
    • Teks pemasaran
    • Kode

Sebuah buku terbuka, halaman web menampilkan teks pemasaran, dan cuplikan kode

Pengantar Model Claude

Pembuatan konten kreatif

  • Melampaui transformasi teks menjadi kreasi asli
    • Cerita
    • Teks pemasaran
    • Kode
    • Email

Sebuah buku terbuka, halaman web menampilkan teks pemasaran, cuplikan kode, dan email

Pengantar Model Claude

Pembuatan konten kreatif

  • Melampaui transformasi teks menjadi kreasi asli
    • Cerita
    • Teks pemasaran
    • Kode
    • Email
    • Naskah

Sebuah buku terbuka, halaman web menampilkan teks pemasaran, cuplikan kode, sebuah email, dan naskah

Pengantar Model Claude

Menyusun prompt generatif yang efektif

$$

  • Spesifisitas
  • Prompt samar: Hasil generik
  • Prompt rinci: Konten terarah
# Vague prompt
prompt = "Write a product description"

# Specific prompt prompt = """Write a 150-word product description for a wireless bluetooth speaker targeting college students. Use an energetic, casual tone and highlight portability, battery life, and sound quality."""
Pengantar Model Claude

Menyusun prompt generatif yang efektif

$$

  • Kasus penggunaan Claude paling umum: kode
  • Prompt spesifik menghasilkan keluaran kode terarah
    • Bahasa pemrograman
    • Fungsionalitas spesifik
    • Kebutuhan penanganan error
    • Keluaran yang diharapkan
# Vague prompt
prompt = "Write some code"

# Specific prompt  
prompt = """Write a Python function 
that validates email addresses 
using regex. 
Include error handling for invalid 
inputs and return both boolean result 
and descriptive error message."""
Pengantar Model Claude

Memahami temperature

  • Rentang temperature: 0,0 (deterministik) hingga 1,0 (sangat kreatif)
    • Suhu rendah (0,1–0,3): Keluaran konsisten, prediktabel
    • Suhu sedang (0,4–0,7): Seimbang antara kreativitas dan koherensi
    • Suhu tinggi (0,8–1,0): Maksimal kreatif, kurang prediktabel

Skala temperature dari 0 hingga 1

Pengantar Model Claude

Parameter temperature di pemanggilan model

# Conservative generation
response1 = client.messages.create(
    model="claude-sonnet-4-6",
    temperature=0.2,
    messages=[{"role": "user", "content": prompt}])

# Creative generation response2 = client.messages.create( temperature=0.8, messages=[{"role": "user", "content": prompt}])
print("Temperature 0.2 Response (Conservative)") print(response1.content[0].text)
print("Temperature 0.8 Response (Creative)") print(response2.content[0].text)
Pengantar Model Claude

Parameter temperature di pemanggilan model

Temperature 0.2 Response (Conservative)
A rainbow is an optical phenomenon that occurs when sunlight and rain are present 
simultaneously. It forms when white light from the sun passes through water 
droplets in the atmosphere, causing the light to refract, reflect, and disperse 
into its component colors...

Temperature 0.8 Response (Creative)
Ah, rainbows! Those magical bridges painted across stormy skies that never fail 
to make us pause and wonder. Picture this: millions of tiny water droplets hanging 
in the air after a rainfall, each one acting like a miniature crystal ball. When 
sunlight hits these droplets, something absolutely enchanting happens...
Pengantar Model Claude

Menggunakan parameter top_p

$$

  • top_p (nucleus sampling): Alternatif selain temperature untuk mengatur kreativitas
  • Nilai umum: 0,1 (terfokus) hingga 0,9 (beragam)
  • Penggunaan gabungan: Dapat memakai temperature dan top_p bersama untuk kontrol presisi

$$

client.messages.create(
model="claude-sonnet-4-6",
temperature=0.7,
top_p=0.3, #Likely words
messages=[{"role":"user", 
           "content":prompt}])
Pengantar Model Claude

Fitur keamanan Claude

$$

  • 📝 Kekuatan konten: Penulisan, analisis, pengodean, tugas kreatif
  • 🚫 Keamanan bawaan: Menolak konten berbahaya, menjaga etika
  • ✅ Praktik terbaik: Prompt jelas, uji parameter, tinjau keluaran
Pengantar Model Claude

Ayo berlatih!

Pengantar Model Claude

Preparing Video For Download...