C.W.K.
Stream
Lesson 02 of 10 · published

System / Developer / User / Assistant prefill

~14 min · conversation, layers, prefill

Level 0수련생
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

단어 둘 곳 다섯

  • System — operator의 constitutive frame. Persistent.
  • Developer — app-level instruction (OpenAI explicit, others implicit inside system).
  • User — 사람 input. Untrusted.
  • Assistant — 모델이 한 말. 다음 turn의 context로 reused.
  • Assistant prefill — assistant 답을 너가 시작. 모델이 거기서 continue.

prefill이 좋은 경우

  • strict mode 없이 JSON output force ({로 시작).
  • preamble skip (실제 답으로 시작).
  • persona enforcement (voice로 시작).
  • format anchoring (table header, bullet, heading으로 시작).

provider quirk

Anthropic이 conversation의 마지막 assistant message로 prefill 지원. OpenAI가 prior assistant turn으로 지원 (first-class param 아님). Gemini가 model role로 지원. 메커니즘 같고 API surface 달라.

Code

Anthropic prefill·python
client.messages.create(
    model="claude-opus-4-7",
    messages=[
        {"role": "user", "content": "List three risks."},
        {"role": "assistant", "content": "{\n  \"risks\": ["}  # prefill
    ],
)
# Model continues from "{ \"risks\": ["

External links

Exercise

preamble 자주 포함하는 ("Sure, here is...") 프롬프트에 답으로 directly 시작하는 assistant prefill 추가. 3개 sample output 비교.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.