본문 바로가기
C.W.K.
Stream
Lesson 04 of 06 · published

서버 도구는 Anthropic이 실행까지 맡아

~16 min · server-tools, web-search, code-execution, computer-use

Level 0Observer
0 XP0/64 lessons0/13 achievements
0/150 XP to next level150 XP to go0% complete

직접 만든 도구와 실행 주체가 달라

Anthropic은 web_search, code_execution, computer_use 같은 서버 도구를 제공해. 커스텀 도구처럼 tools에 넣지만 실행은 애플리케이션이 아니라 Anthropic 쪽에서 처리해. 검색 연결이나 Python 격리 환경을 처음부터 만들지 않고도 능력을 붙일 수 있어.

검색과 코드 실행은 추측을 줄여

web_search는 모델의 학습 시점 뒤 정보를 가져오고, code_execution은 산수와 데이터 처리를 실제 Python으로 계산하게 해. 둘 다 별도 비용과 호출 한도, 요청당 검색 수나 샌드박스 자원 같은 설정이 있으니 가격과 제한을 확인해야 해.

computer_use는 훨씬 넓은 권한을 가져

computer_use는 화면을 보고 마우스와 키보드 동작을 내보내 가상 데스크톱을 조작해. 오래된 GUI 입력, 일반 자동화가 막히는 브라우징, 접근성 시험에 쓸 수 있지만 잘못된 클릭의 피해 범위도 커. 격리 환경과 허용 목록, 사람의 승인을 함께 두는 강력한 도구야.

원칙: Anthropic이 안정적으로 제공하는 실행 능력은 활용하되, 비용과 권한 경계까지 함께 받아들여.

Code

web_search·code_execution 추가·python
resp = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=2048,
    tools=[
        {
            "type": "web_search_20250305",
            "name": "web_search",
            "max_uses": 5,
        },
        {
            "type": "code_execution_20250522",
            "name": "code_execution",
        },
        # ... 너 커스텀 도구도 함께
    ],
    messages=[{"role": "user", "content": "What was the closing S&P 500 yesterday? Show the calculation in Python."}],
)
computer_use sketch (Python)·python
# computer_use는 샌드박스 데스크톱 필요; 여기는 요청 모양만.
resp = client.beta.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=4096,
    tools=[
        {
            "type": "computer_20241022",
            "name": "computer",
            "display_width_px": 1280,
            "display_height_px": 720,
        }
    ],
    betas=["computer-use-2024-10-22"],
    messages=[{"role": "user", "content": "Open Firefox and go to anthropic.com"}],
)
# 각 tool_use 블록이 좌표 기반 액션; tool_result로 스크린샷 stream back.

External links

Exercise

사용자 정의 도구 하나를 알맞은 서버 도구로 바꿔 봐. Google API 포장은 web_search로, Python 계산 다리는 code_execution으로 대체하고 신뢰성과 비용을 비교해.
Hint
서버 도구가 더 안정적일 수 있지만 실제 호출량의 가격은 공식 가격표로 계산해.

Progress

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

댓글 0

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

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