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

Built-in Tools — web_search, code_interpreter, file_search

~22 min · hosted-tools, web-search, code-interpreter, file-search

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

Responses 의 hosted tool 은 한 줄로 들어와 — tools=[{"type":"web_search"}]. 같은 capability 를 직접 만들면 multi-week project. Default 로 hosted, hosted 가 안 맞을 때만 custom.

3 개의 hosted tool

  • web_search — OpenAI 가 search provider 결정. 즉시 동작.
  • code_interpreter — Python 실행 환경. 모델이 코드 작성 + 실행 + 결과 해석.
  • file_search — Vector store 위 RAG. PDF, doc 업로드 후 query.

Pricing 따로

Hosted tool 은 invocation 당 charge. Web_search 와 code_interpreter 는 호출당 요금, file_search 는 query + per-MB-stored. 사용자가 loop 안에서 chain 시키도록 두기 전에 pricing 페이지 읽어봐.

Custom 으로 갈 시점

Hosted web_search 가 OpenAI provider 쓴다는 게 lock-in 으로 느껴지면 custom function tool 로 자기 search wrap. 대부분 product use case 엔 hosted 가 충분 — 가끔 안 맞을 때만.

Code

web_search 와 code_interpreter 활성화·python
# Web search
response = client.responses.create(
    model="gpt-5.4",
    input="What is the current price of NVIDIA stock?",
    tools=[{"type": "web_search"}],
)

# File search (requires vector store)
response = client.responses.create(
    model="gpt-5.4",
    input="Summarize the Q3 earnings report.",
    tools=[{"type": "file_search", "vector_store_ids": ["vs_abc123"]}],
)

# Code interpreter
response = client.responses.create(
    model="gpt-5.4",
    input="Calculate the 10,000th Fibonacci number.",
    tools=[{"type": "code_interpreter"}],
)

# Image generation
response = client.responses.create(
    model="gpt-4.1-mini",
    input="Generate an image of a sunset over the ocean.",
    tools=[{"type": "image_generation"}],
)

# Computer use
response = client.responses.create(
    model="computer-use-preview",
    input="Take a screenshot and tell me what's on the screen.",
    tools=[{"type": "computer", "display_width": 1024, "display_height": 768}],
)

External links

Exercise

web_search + 5 PDF file_search vector store 둘 다 접근 가능한 Q&A loop build. 모델이 어느 tool 을 어떤 question 에 invoke 했는지 추적. System instruction 을 tune 해서 routing 이 직관과 맞을 때까지.

Progress

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

댓글 0

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

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