From e6f39b62099dd180d3cf24924331b931ec8b84a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 20:52:39 +0000 Subject: [PATCH 1/2] fix(search): remove search_context_size from search.create (premature) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Mikhail's request 2026-05-27 in group DM: backend naming rename is in progress across multiple services; SAPI currently accepts only `snippet_mode`. The SDK should not expose `search_context_size` on `/search` until the cross-service rename lands. Pure subtraction — removes one typed kwarg from ApiSearchRequest. All other 0.35.0 additions retained: - background param + responses.retrieve method - xhigh/minimal reasoning effort - Status.queued/cancelled enum values - streaming fix from 0.34.1 Sonar (chat.completions web_search_options.search_context_size) untouched. --- .stats.yml | 4 ++-- src/perplexity/resources/search.py | 10 ---------- src/perplexity/types/search_create_params.py | 6 ------ tests/api_resources/test_search.py | 2 -- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index aa3b4f6..d1807d0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 11 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai/perplexity-fff71875865f090e567436080392bfe633cefac2a82f5eba143ca6fcfed86a56.yml -openapi_spec_hash: 2cb780b456c70cbdcb1ba0182f424c9b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai/perplexity-6f1190943034b93890a9c218eea0630d4b0de4018e3ca97a48fb467bdcf0c5a2.yml +openapi_spec_hash: 852b17614efb5895a656a42d5fa2f08a config_hash: 059988c88f0dc18e9e393daed94b5eb6 diff --git a/src/perplexity/resources/search.py b/src/perplexity/resources/search.py index de9c388..06f9f62 100644 --- a/src/perplexity/resources/search.py +++ b/src/perplexity/resources/search.py @@ -57,7 +57,6 @@ def create( max_tokens_per_page: int | Omit = omit, search_after_date_filter: Optional[str] | Omit = omit, search_before_date_filter: Optional[str] | Omit = omit, - search_context_size: Optional[Literal["low", "medium", "high"]] | Omit = omit, search_domain_filter: Optional[SequenceNotStr[str]] | Omit = omit, search_language_filter: Optional[SequenceNotStr[str]] | Omit = omit, search_mode: Optional[Literal["web", "academic", "sec"]] | Omit = omit, @@ -74,9 +73,6 @@ def create( Search the web and retrieve relevant web page contents. Args: - search_context_size: Controls how much search context is retrieved. Higher values return more content - per result. - search_type: Search type — "web" for general web search, "people" for people search. max_results above 20 is only supported for people search. @@ -102,7 +98,6 @@ def create( "max_tokens_per_page": max_tokens_per_page, "search_after_date_filter": search_after_date_filter, "search_before_date_filter": search_before_date_filter, - "search_context_size": search_context_size, "search_domain_filter": search_domain_filter, "search_language_filter": search_language_filter, "search_mode": search_mode, @@ -151,7 +146,6 @@ async def create( max_tokens_per_page: int | Omit = omit, search_after_date_filter: Optional[str] | Omit = omit, search_before_date_filter: Optional[str] | Omit = omit, - search_context_size: Optional[Literal["low", "medium", "high"]] | Omit = omit, search_domain_filter: Optional[SequenceNotStr[str]] | Omit = omit, search_language_filter: Optional[SequenceNotStr[str]] | Omit = omit, search_mode: Optional[Literal["web", "academic", "sec"]] | Omit = omit, @@ -168,9 +162,6 @@ async def create( Search the web and retrieve relevant web page contents. Args: - search_context_size: Controls how much search context is retrieved. Higher values return more content - per result. - search_type: Search type — "web" for general web search, "people" for people search. max_results above 20 is only supported for people search. @@ -196,7 +187,6 @@ async def create( "max_tokens_per_page": max_tokens_per_page, "search_after_date_filter": search_after_date_filter, "search_before_date_filter": search_before_date_filter, - "search_context_size": search_context_size, "search_domain_filter": search_domain_filter, "search_language_filter": search_language_filter, "search_mode": search_mode, diff --git a/src/perplexity/types/search_create_params.py b/src/perplexity/types/search_create_params.py index 76e6a4b..9467457 100644 --- a/src/perplexity/types/search_create_params.py +++ b/src/perplexity/types/search_create_params.py @@ -31,12 +31,6 @@ class SearchCreateParams(TypedDict, total=False): search_before_date_filter: Optional[str] - search_context_size: Optional[Literal["low", "medium", "high"]] - """Controls how much search context is retrieved. - - Higher values return more content per result. - """ - search_domain_filter: Optional[SequenceNotStr[str]] search_language_filter: Optional[SequenceNotStr[str]] diff --git a/tests/api_resources/test_search.py b/tests/api_resources/test_search.py index 9af46e8..dc89d8e 100644 --- a/tests/api_resources/test_search.py +++ b/tests/api_resources/test_search.py @@ -39,7 +39,6 @@ def test_method_create_with_all_params(self, client: Perplexity) -> None: max_tokens_per_page=0, search_after_date_filter="search_after_date_filter", search_before_date_filter="search_before_date_filter", - search_context_size="low", search_domain_filter=["string"], search_language_filter=["string"], search_mode="web", @@ -102,7 +101,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncPerplexity max_tokens_per_page=0, search_after_date_filter="search_after_date_filter", search_before_date_filter="search_before_date_filter", - search_context_size="low", search_domain_filter=["string"], search_language_filter=["string"], search_mode="web", From e3bc20506206012affb14f7221976be4f6d68ada Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 20:53:02 +0000 Subject: [PATCH 2/2] release: 0.35.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/perplexity/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ce5e5c7..af1fd43 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.35.0" + ".": "0.35.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bda020..daf61cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.35.1 (2026-05-27) + +Full Changelog: [v0.35.0...v0.35.1](https://github.com/perplexityai/perplexity-py/compare/v0.35.0...v0.35.1) + +### Bug Fixes + +* **search:** remove search_context_size from search.create (premature) ([e6f39b6](https://github.com/perplexityai/perplexity-py/commit/e6f39b62099dd180d3cf24924331b931ec8b84a4)) + ## 0.35.0 (2026-05-27) Full Changelog: [v0.34.1...v0.35.0](https://github.com/perplexityai/perplexity-py/compare/v0.34.1...v0.35.0) diff --git a/pyproject.toml b/pyproject.toml index b096298..5010a5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "perplexityai" -version = "0.35.0" +version = "0.35.1" description = "The official Python library for the perplexity API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/perplexity/_version.py b/src/perplexity/_version.py index 81e299c..533d4f4 100644 --- a/src/perplexity/_version.py +++ b/src/perplexity/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "perplexity" -__version__ = "0.35.0" # x-release-please-version +__version__ = "0.35.1" # x-release-please-version