웹 페치

웹 페치 (Web Fetch)

WebFetch 캐퍼빌리티는 에이전트가 URL의 내용을 가져올 수 있게 해 줘요. 다른 provider-adaptive tools처럼 공급자의 네이티브 웹 페치 도구를 선호하고, 다른 모델에서는 로컬 구현으로 폴백할 수 있습니다.

출처: 문서

본문

WebFetch는 기본적으로 네이티브 전용이에요. 네이티브 측은 WebFetchTool로 뒷받침됩니다 (공급자 지원과 설정은 Web Fetch Tool 참고) — native=WebFetchTool(...)를 직접 전달하면 완전히 제어할 수 있어요.

로컬 측은 local=True를 전달하면 번들된 markdownify 기반 페치 도구를 사용합니다 (web-fetch 옵션 그룹 필요), 또는 callable, Tool, AbstractToolset 아무거나 전달할 수 있어요.

네이티브 제약 필드: allowed_domains, blocked_domains, max_uses, enable_citations, max_content_tokens. 네이티브가 꼭 필요한 것은 max_uses뿐이에요. 도메인 필터는 네이티브를 못 쓸 때 로컬에서 적용됩니다.

from pydantic_ai.capabilities import WebFetch

# Native-only -- raises on models without native web fetch
WebFetch()

# Native preferred; markdownify-based fallback (needs `pydantic-ai-slim[web-fetch]`)
WebFetch(local=True)

# Domain filters enforced locally when native isn't available
WebFetch(allowed_domains=['example.com'], local=True)

더 알아보기 (Learn more)