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

Tool choice — required vs auto vs none

~12 min · tools, tool-choice

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

3개 mode, 3개 행동

  • auto — 모델이 tool 부를지 직접 답할지 결정. chat default.
  • required / any — 모델이 어떤 tool은 불러야. tool-only path로 task 좁혔을 때 유용.
  • 이름 박힌 tool — 모델이 이 specific tool 불러야. JSON schema enforce하는 가장 깨끗한 방법 (Anthropic JSON 패턴).
  • none — tool calling 비활성. router의 'just answer' branch에 유용.

이게 왜 prompt decision인가

Tool choice가 contract 변경. required 쓰면 "directly answer" 옵션 빼버린 거야; 프롬프트가 그걸 obvious하게 만들어야지 안 그러면 모델이 ill-fitting tool call 만들어. auto 쓰면 프롬프트가 모델한테 언제 tool 안 부를지 알려야 해 — 안 그러면 반사적으로 tool-call.

Code

Forced specific tool (Anthropic)·python
client.messages.create(
    model="claude-opus-4-7",
    tools=[verdict_tool],
    tool_choice={"type": "tool", "name": "emit_verdict"},
    messages=[...]
)
Required-any (OpenAI)·python
client.chat.completions.create(
    model="gpt-5.5",
    tools=[t1, t2, t3],
    tool_choice="required",
    messages=[...]
)

External links

Exercise

현재 'auto' 인 tool-using prompt에서 모델이 안 불러야 할 때 부르는 case 식별. "do not call tools when X"를 프롬프트에 추가하거나 그 branch에서 'none'으로 switch. 개선 측정.

Progress

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

댓글 0

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

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