diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6b7b74c..cce9240 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.3.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 97f6d7e..69050cb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 13 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-e853fc79f3b41f00b3934fcc2e4c2813aa9f38528548f5f596e2b11ea833019b.yml openapi_spec_hash: 34ed7e373927037fce6fd33d9bb60389 -config_hash: ae63572e3769dcd1b11e587f039e211a +config_hash: 49716a82995763fddc4308b0b302f1cb diff --git a/CHANGELOG.md b/CHANGELOG.md index c8dc474..d116a27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.3.1 (2025-10-21) + +Full Changelog: [v0.3.0...v0.3.1](https://github.com/parallel-web/parallel-sdk-python/compare/v0.3.0...v0.3.1) + +### Features + +* **api:** manual updates ([0acbe77](https://github.com/parallel-web/parallel-sdk-python/commit/0acbe77da0148029c21e6b3c541e0b1ca163038d)) + ## 0.3.0 (2025-10-21) Full Changelog: [v0.2.2...v0.3.0](https://github.com/parallel-web/parallel-sdk-python/compare/v0.2.2...v0.3.0) diff --git a/api.md b/api.md index 04a9a8f..5d4753f 100644 --- a/api.md +++ b/api.md @@ -45,6 +45,7 @@ from parallel.types.beta import ( ExtractError, ExtractResponse, ExtractResult, + FetchPolicy, SearchResult, WebSearchResult, ) diff --git a/pyproject.toml b/pyproject.toml index dad487e..b34cacf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "parallel-web" -version = "0.3.0" +version = "0.3.1" description = "The official Python library for the Parallel API" dynamic = ["readme"] license = "MIT" diff --git a/src/parallel/_version.py b/src/parallel/_version.py index 79f0776..fe60eb6 100644 --- a/src/parallel/_version.py +++ b/src/parallel/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "parallel" -__version__ = "0.3.0" # x-release-please-version +__version__ = "0.3.1" # x-release-please-version diff --git a/src/parallel/resources/beta/beta.py b/src/parallel/resources/beta/beta.py index b15863a..4def816 100644 --- a/src/parallel/resources/beta/beta.py +++ b/src/parallel/resources/beta/beta.py @@ -37,6 +37,7 @@ from ..._base_client import make_request_options from ...types.beta.search_result import SearchResult from ...types.beta.extract_response import ExtractResponse +from ...types.beta.fetch_policy_param import FetchPolicyParam from ...types.beta.parallel_beta_param import ParallelBetaParam from ...types.shared_params.source_policy import SourcePolicy @@ -76,7 +77,7 @@ def extract( *, urls: SequenceNotStr[str], excerpts: beta_extract_params.Excerpts | Omit = omit, - fetch_policy: Optional[beta_extract_params.FetchPolicy] | Omit = omit, + fetch_policy: Optional[FetchPolicyParam] | Omit = omit, full_content: beta_extract_params.FullContent | Omit = omit, objective: Optional[str] | Omit = omit, search_queries: Optional[SequenceNotStr[str]] | Omit = omit, @@ -252,7 +253,7 @@ async def extract( *, urls: SequenceNotStr[str], excerpts: beta_extract_params.Excerpts | Omit = omit, - fetch_policy: Optional[beta_extract_params.FetchPolicy] | Omit = omit, + fetch_policy: Optional[FetchPolicyParam] | Omit = omit, full_content: beta_extract_params.FullContent | Omit = omit, objective: Optional[str] | Omit = omit, search_queries: Optional[SequenceNotStr[str]] | Omit = omit, diff --git a/src/parallel/types/beta/__init__.py b/src/parallel/types/beta/__init__.py index 2dfb1da..2575ac7 100644 --- a/src/parallel/types/beta/__init__.py +++ b/src/parallel/types/beta/__init__.py @@ -18,6 +18,7 @@ from .task_group_status import TaskGroupStatus as TaskGroupStatus from .web_search_result import WebSearchResult as WebSearchResult from .beta_search_params import BetaSearchParams as BetaSearchParams +from .fetch_policy_param import FetchPolicyParam as FetchPolicyParam from .beta_extract_params import BetaExtractParams as BetaExtractParams from .parallel_beta_param import ParallelBetaParam as ParallelBetaParam from .beta_run_input_param import BetaRunInputParam as BetaRunInputParam diff --git a/src/parallel/types/beta/beta_extract_params.py b/src/parallel/types/beta/beta_extract_params.py index 8f67c8c..cc6ded8 100644 --- a/src/parallel/types/beta/beta_extract_params.py +++ b/src/parallel/types/beta/beta_extract_params.py @@ -7,10 +7,11 @@ from ..._types import SequenceNotStr from ..._utils import PropertyInfo +from .fetch_policy_param import FetchPolicyParam from .parallel_beta_param import ParallelBetaParam from .excerpt_settings_param import ExcerptSettingsParam -__all__ = ["BetaExtractParams", "Excerpts", "FetchPolicy", "FullContent", "FullContentFullContentSettings"] +__all__ = ["BetaExtractParams", "Excerpts", "FullContent", "FullContentFullContentSettings"] class BetaExtractParams(TypedDict, total=False): @@ -23,7 +24,7 @@ class BetaExtractParams(TypedDict, total=False): redundant with full content. """ - fetch_policy: Optional[FetchPolicy] + fetch_policy: Optional[FetchPolicyParam] """Fetch policy. Determines when to return content from the cache (faster) vs fetching live @@ -50,29 +51,6 @@ class BetaExtractParams(TypedDict, total=False): Excerpts: TypeAlias = Union[bool, ExcerptSettingsParam] -class FetchPolicy(TypedDict, total=False): - disable_cache_fallback: bool - """ - If false, fallback to cached content older than max-age if live fetch fails or - times out. If true, returns an error instead. - """ - - max_age_seconds: Optional[int] - """Maximum age of cached content in seconds to trigger a live fetch. - - Minimum value 600 seconds (10 minutes). If not provided, a dynamic age policy - will be used based on the search objective and url. - """ - - timeout_seconds: Optional[float] - """Timeout in seconds for fetching live content if unavailable in cache. - - If unspecified a dynamic timeout will be used based on the url, generally 15 - seconds for simple pages and up to 60 seconds for complex pages requiring - javascript or PDF rendering. - """ - - class FullContentFullContentSettings(TypedDict, total=False): max_chars_per_result: Optional[int] """ diff --git a/src/parallel/types/beta/fetch_policy_param.py b/src/parallel/types/beta/fetch_policy_param.py new file mode 100644 index 0000000..bd003aa --- /dev/null +++ b/src/parallel/types/beta/fetch_policy_param.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["FetchPolicyParam"] + + +class FetchPolicyParam(TypedDict, total=False): + disable_cache_fallback: bool + """ + If false, fallback to cached content older than max-age if live fetch fails or + times out. If true, returns an error instead. + """ + + max_age_seconds: Optional[int] + """Maximum age of cached content in seconds to trigger a live fetch. + + Minimum value 600 seconds (10 minutes). If not provided, a dynamic age policy + will be used based on the search objective and url. + """ + + timeout_seconds: Optional[float] + """Timeout in seconds for fetching live content if unavailable in cache. + + If unspecified a dynamic timeout will be used based on the url, generally 15 + seconds for simple pages and up to 60 seconds for complex pages requiring + javascript or PDF rendering. + """