C.W.K.
Stream
Lesson 03 of 07 · published

GPT 가 tool 호출 결정하는 법 — tool_choice

~22 min · tool-decision, tool_choice

Level 0Tokenizer
0 XP0/54 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

모델이 tool 을 부를지 텍스트로 답할지 결정하는 knob 가 tool_choice. 세 모드 — 'auto' (모델 결정), 'required' (반드시 tool 호출), {type:'function',name:'X'} (특정 tool 강제).

'required' 의 용도

Eval 에서 모델의 'argument-construction' 능력을 'routing' 능력과 분리해서 측정할 때. Required 박으면 tool 부르기로는 결정됐고, arguments 가 어떻게 나오는지만 봐.

특정 tool name 강제

tool_choice={'type':'function','name':'X'} = tool X 강제. Pipeline 의 특정 step 을 deterministic 하게 박을 때 — 'web_search 부른 후 summarize' 같은 fixed sequence.

'auto' 가 default — 그래서 description 이 중요

'auto' 에선 tool description 이 routing 결정. Vague description = mis-route. Specific description with negative example = clean route. Designing Effective Tool Descriptions lesson 참조.

Code

tool_choice='auto' vs 'required' vs specific·python
# Force a specific function call
response = client.responses.create(
    model="gpt-5.4",
    input="What's the weather?",
    tools=tools,
    tool_choice={"type": "function", "name": "get_weather"},
)

# Require at least one tool call
response = client.responses.create(
    model="gpt-5.4",
    input="Look up current events.",
    tools=tools,
    tool_choice="required",
)

External links

Exercise

Tool 1 개에 같은 prompt 를 tool_choice 'auto', 'required', 그리고 specific name 으로 3 번 실행. 'auto' 에서 모델이 skip 하는 input, 'required' 에서 강제되는 input 메모.

Progress

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

댓글 0

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

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