|
| 1 | +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +from __future__ import annotations |
| 4 | + |
| 5 | +from typing import List, Optional |
| 6 | +from typing_extensions import Literal, Required, TypedDict |
| 7 | + |
| 8 | +from ..._types import SequenceNotStr |
| 9 | +from .beta_citations_config_param import BetaCitationsConfigParam |
| 10 | +from .beta_cache_control_ephemeral_param import BetaCacheControlEphemeralParam |
| 11 | + |
| 12 | +__all__ = ["BetaWebFetchTool20260309Param"] |
| 13 | + |
| 14 | + |
| 15 | +class BetaWebFetchTool20260309Param(TypedDict, total=False): |
| 16 | + """Web fetch tool with use_cache parameter for bypassing cached content.""" |
| 17 | + |
| 18 | + name: Required[Literal["web_fetch"]] |
| 19 | + """Name of the tool. |
| 20 | +
|
| 21 | + This is how the tool will be called by the model and in `tool_use` blocks. |
| 22 | + """ |
| 23 | + |
| 24 | + type: Required[Literal["web_fetch_20260309"]] |
| 25 | + |
| 26 | + allowed_callers: List[Literal["direct", "code_execution_20250825", "code_execution_20260120"]] |
| 27 | + |
| 28 | + allowed_domains: Optional[SequenceNotStr[str]] |
| 29 | + """List of domains to allow fetching from""" |
| 30 | + |
| 31 | + blocked_domains: Optional[SequenceNotStr[str]] |
| 32 | + """List of domains to block fetching from""" |
| 33 | + |
| 34 | + cache_control: Optional[BetaCacheControlEphemeralParam] |
| 35 | + """Create a cache control breakpoint at this content block.""" |
| 36 | + |
| 37 | + citations: Optional[BetaCitationsConfigParam] |
| 38 | + """Citations configuration for fetched documents. |
| 39 | +
|
| 40 | + Citations are disabled by default. |
| 41 | + """ |
| 42 | + |
| 43 | + defer_loading: bool |
| 44 | + """If true, tool will not be included in initial system prompt. |
| 45 | +
|
| 46 | + Only loaded when returned via tool_reference from tool search. |
| 47 | + """ |
| 48 | + |
| 49 | + max_content_tokens: Optional[int] |
| 50 | + """Maximum number of tokens used by including web page text content in the context. |
| 51 | +
|
| 52 | + The limit is approximate and does not apply to binary content such as PDFs. |
| 53 | + """ |
| 54 | + |
| 55 | + max_uses: Optional[int] |
| 56 | + """Maximum number of times the tool can be used in the API request.""" |
| 57 | + |
| 58 | + strict: bool |
| 59 | + """When true, guarantees schema validation on tool names and inputs""" |
| 60 | + |
| 61 | + use_cache: bool |
| 62 | + """Whether to use cached content. |
| 63 | +
|
| 64 | + Set to false to bypass the cache and fetch fresh content. Only set to false when |
| 65 | + the user explicitly requests fresh content or when fetching rapidly-changing |
| 66 | + sources. |
| 67 | + """ |
0 commit comments