diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4ad3fef..e756293 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.0" + ".": "0.19.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 19c4bb4..806d246 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 5 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-335f0ceddae39ba77e5abf8b2b72691a43174b25c2ec897cd7779db8d1524820.yml -openapi_spec_hash: e34fc7a3c97b61c7aded4df4774f298e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-5d4ba4296d72d87995a2189a991e710a77b4b73cc275ad03d8a0eec245cf55db.yml +openapi_spec_hash: 5d29546ef1490dda18cda8ca97cd665e config_hash: 4e2c5b7ad4caa07a2ac1af091ecf6c9c diff --git a/CHANGELOG.md b/CHANGELOG.md index 778f995..bd02f62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.19.0 (2025-10-30) + +Full Changelog: [v0.18.0...v0.19.0](https://github.com/perplexityai/perplexity-py/compare/v0.18.0...v0.19.0) + +### Features + +* **api:** manual updates ([d32c134](https://github.com/perplexityai/perplexity-py/commit/d32c1346744e5521a50da56e0d5a81261fd53f27)) + ## 0.18.0 (2025-10-29) Full Changelog: [v0.17.1...v0.18.0](https://github.com/perplexityai/perplexity-py/compare/v0.17.1...v0.18.0) diff --git a/README.md b/README.md index ababed6..f0ff7a3 100644 --- a/README.md +++ b/README.md @@ -211,9 +211,9 @@ stream_chunk = client.chat.completions.create( } ], model="model", - debug_params={}, + web_search_options={}, ) -print(stream_chunk.debug_params) +print(stream_chunk.web_search_options) ``` ## Handling errors diff --git a/pyproject.toml b/pyproject.toml index 7f4f960..96b56fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "perplexityai" -version = "0.18.0" +version = "0.19.0" 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 409b931..9eb6d30 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.18.0" # x-release-please-version +__version__ = "0.19.0" # x-release-please-version diff --git a/src/perplexity/resources/chat/completions.py b/src/perplexity/resources/chat/completions.py index d44129b..4de02f9 100644 --- a/src/perplexity/resources/chat/completions.py +++ b/src/perplexity/resources/chat/completions.py @@ -59,7 +59,6 @@ def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -143,7 +142,6 @@ def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -226,7 +224,6 @@ def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -308,7 +305,6 @@ def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -377,7 +373,6 @@ def create( "best_of": best_of, "country": country, "cum_logprobs": cum_logprobs, - "debug_params": debug_params, "disable_search": disable_search, "diverse_first_token": diverse_first_token, "enable_search_classifier": enable_search_classifier, @@ -473,7 +468,6 @@ async def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -557,7 +551,6 @@ async def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -640,7 +633,6 @@ async def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -722,7 +714,6 @@ async def create( best_of: Optional[int] | Omit = omit, country: Optional[str] | Omit = omit, cum_logprobs: Optional[bool] | Omit = omit, - debug_params: Optional[completion_create_params.DebugParams] | Omit = omit, disable_search: Optional[bool] | Omit = omit, diverse_first_token: Optional[bool] | Omit = omit, enable_search_classifier: Optional[bool] | Omit = omit, @@ -791,7 +782,6 @@ async def create( "best_of": best_of, "country": country, "cum_logprobs": cum_logprobs, - "debug_params": debug_params, "disable_search": disable_search, "diverse_first_token": diverse_first_token, "enable_search_classifier": enable_search_classifier, diff --git a/src/perplexity/types/async_/chat/completion_create_params.py b/src/perplexity/types/async_/chat/completion_create_params.py index 351de27..f8ab1e3 100644 --- a/src/perplexity/types/async_/chat/completion_create_params.py +++ b/src/perplexity/types/async_/chat/completion_create_params.py @@ -11,7 +11,6 @@ __all__ = [ "CompletionCreateParams", "Request", - "RequestDebugParams", "RequestResponseFormat", "RequestResponseFormatResponseFormatText", "RequestResponseFormatResponseFormatJsonSchema", @@ -32,12 +31,6 @@ class CompletionCreateParams(TypedDict, total=False): idempotency_key: Optional[str] -class RequestDebugParams(TypedDict, total=False): - summarizer_model_override: Optional[str] - - summarizer_prompt_override: Optional[str] - - class RequestResponseFormatResponseFormatText(TypedDict, total=False): type: Required[Literal["text"]] @@ -148,8 +141,6 @@ class Request(TypedDict, total=False): cum_logprobs: Optional[bool] - debug_params: Optional[RequestDebugParams] - disable_search: Optional[bool] diverse_first_token: Optional[bool] diff --git a/src/perplexity/types/chat/completion_create_params.py b/src/perplexity/types/chat/completion_create_params.py index 8a26fa0..d88da4f 100644 --- a/src/perplexity/types/chat/completion_create_params.py +++ b/src/perplexity/types/chat/completion_create_params.py @@ -10,7 +10,6 @@ __all__ = [ "CompletionCreateParamsBase", - "DebugParams", "ResponseFormat", "ResponseFormatResponseFormatText", "ResponseFormatResponseFormatJsonSchema", @@ -46,8 +45,6 @@ class CompletionCreateParamsBase(TypedDict, total=False): cum_logprobs: Optional[bool] - debug_params: Optional[DebugParams] - disable_search: Optional[bool] diverse_first_token: Optional[bool] @@ -143,12 +140,6 @@ class CompletionCreateParamsBase(TypedDict, total=False): web_search_options: WebSearchOptions -class DebugParams(TypedDict, total=False): - summarizer_model_override: Optional[str] - - summarizer_prompt_override: Optional[str] - - class ResponseFormatResponseFormatText(TypedDict, total=False): type: Required[Literal["text"]] diff --git a/src/perplexity/types/shared/chat_message_input.py b/src/perplexity/types/shared/chat_message_input.py index e4a1cd0..a2829f3 100644 --- a/src/perplexity/types/shared/chat_message_input.py +++ b/src/perplexity/types/shared/chat_message_input.py @@ -155,16 +155,6 @@ class ReasoningStepWebSearch(BaseModel): class ReasoningStep(BaseModel): thought: str - type: Literal[ - "web_search", - "fetch_url_content", - "execute_python", - "agent_progress", - "browser_agent", - "browser_tool_execution", - "file_attachment_search", - ] - agent_progress: Optional[ReasoningStepAgentProgress] = None """Agent progress class for live-browsing updates""" @@ -183,6 +173,8 @@ class ReasoningStep(BaseModel): file_attachment_search: Optional[ReasoningStepFileAttachmentSearch] = None """File attachment search step details wrapper class""" + type: Optional[str] = None + web_search: Optional[ReasoningStepWebSearch] = None """Web search step details wrapper class""" diff --git a/src/perplexity/types/shared/chat_message_output.py b/src/perplexity/types/shared/chat_message_output.py index 161c4ce..d415650 100644 --- a/src/perplexity/types/shared/chat_message_output.py +++ b/src/perplexity/types/shared/chat_message_output.py @@ -155,16 +155,6 @@ class ReasoningStepWebSearch(BaseModel): class ReasoningStep(BaseModel): thought: str - type: Literal[ - "web_search", - "fetch_url_content", - "execute_python", - "agent_progress", - "browser_agent", - "browser_tool_execution", - "file_attachment_search", - ] - agent_progress: Optional[ReasoningStepAgentProgress] = None """Agent progress class for live-browsing updates""" @@ -183,6 +173,8 @@ class ReasoningStep(BaseModel): file_attachment_search: Optional[ReasoningStepFileAttachmentSearch] = None """File attachment search step details wrapper class""" + type: Optional[str] = None + web_search: Optional[ReasoningStepWebSearch] = None """Web search step details wrapper class""" diff --git a/src/perplexity/types/shared_params/chat_message_input.py b/src/perplexity/types/shared_params/chat_message_input.py index 4f20459..b3dbbc9 100644 --- a/src/perplexity/types/shared_params/chat_message_input.py +++ b/src/perplexity/types/shared_params/chat_message_input.py @@ -157,18 +157,6 @@ class ReasoningStepWebSearch(TypedDict, total=False): class ReasoningStep(TypedDict, total=False): thought: Required[str] - type: Required[ - Literal[ - "web_search", - "fetch_url_content", - "execute_python", - "agent_progress", - "browser_agent", - "browser_tool_execution", - "file_attachment_search", - ] - ] - agent_progress: Optional[ReasoningStepAgentProgress] """Agent progress class for live-browsing updates""" @@ -187,6 +175,8 @@ class ReasoningStep(TypedDict, total=False): file_attachment_search: Optional[ReasoningStepFileAttachmentSearch] """File attachment search step details wrapper class""" + type: Optional[str] + web_search: Optional[ReasoningStepWebSearch] """Web search step details wrapper class""" diff --git a/tests/api_resources/async_/chat/test_completions.py b/tests/api_resources/async_/chat/test_completions.py index e689e1e..4a5b5cc 100644 --- a/tests/api_resources/async_/chat/test_completions.py +++ b/tests/api_resources/async_/chat/test_completions.py @@ -49,7 +49,6 @@ def test_method_create_with_all_params(self, client: Perplexity) -> None: "reasoning_steps": [ { "thought": "thought", - "type": "web_search", "agent_progress": { "action": "action", "screenshot": "screenshot", @@ -77,6 +76,7 @@ def test_method_create_with_all_params(self, client: Perplexity) -> None: ] }, "file_attachment_search": {"attachment_urls": ["string"]}, + "type": "type", "web_search": { "search_keywords": ["string"], "search_results": [ @@ -112,10 +112,6 @@ def test_method_create_with_all_params(self, client: Perplexity) -> None: "best_of": 0, "country": "country", "cum_logprobs": True, - "debug_params": { - "summarizer_model_override": "summarizer_model_override", - "summarizer_prompt_override": "summarizer_prompt_override", - }, "disable_search": True, "diverse_first_token": True, "enable_search_classifier": True, @@ -356,7 +352,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncPerplexity "reasoning_steps": [ { "thought": "thought", - "type": "web_search", "agent_progress": { "action": "action", "screenshot": "screenshot", @@ -384,6 +379,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncPerplexity ] }, "file_attachment_search": {"attachment_urls": ["string"]}, + "type": "type", "web_search": { "search_keywords": ["string"], "search_results": [ @@ -419,10 +415,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncPerplexity "best_of": 0, "country": "country", "cum_logprobs": True, - "debug_params": { - "summarizer_model_override": "summarizer_model_override", - "summarizer_prompt_override": "summarizer_prompt_override", - }, "disable_search": True, "diverse_first_token": True, "enable_search_classifier": True, diff --git a/tests/api_resources/chat/test_completions.py b/tests/api_resources/chat/test_completions.py index 0ce77a1..da87aa5 100644 --- a/tests/api_resources/chat/test_completions.py +++ b/tests/api_resources/chat/test_completions.py @@ -42,7 +42,6 @@ def test_method_create_with_all_params_overload_1(self, client: Perplexity) -> N "reasoning_steps": [ { "thought": "thought", - "type": "web_search", "agent_progress": { "action": "action", "screenshot": "screenshot", @@ -70,6 +69,7 @@ def test_method_create_with_all_params_overload_1(self, client: Perplexity) -> N ] }, "file_attachment_search": {"attachment_urls": ["string"]}, + "type": "type", "web_search": { "search_keywords": ["string"], "search_results": [ @@ -105,10 +105,6 @@ def test_method_create_with_all_params_overload_1(self, client: Perplexity) -> N best_of=0, country="country", cum_logprobs=True, - debug_params={ - "summarizer_model_override": "summarizer_model_override", - "summarizer_prompt_override": "summarizer_prompt_override", - }, disable_search=True, diverse_first_token=True, enable_search_classifier=True, @@ -250,7 +246,6 @@ def test_method_create_with_all_params_overload_2(self, client: Perplexity) -> N "reasoning_steps": [ { "thought": "thought", - "type": "web_search", "agent_progress": { "action": "action", "screenshot": "screenshot", @@ -278,6 +273,7 @@ def test_method_create_with_all_params_overload_2(self, client: Perplexity) -> N ] }, "file_attachment_search": {"attachment_urls": ["string"]}, + "type": "type", "web_search": { "search_keywords": ["string"], "search_results": [ @@ -314,10 +310,6 @@ def test_method_create_with_all_params_overload_2(self, client: Perplexity) -> N best_of=0, country="country", cum_logprobs=True, - debug_params={ - "summarizer_model_override": "summarizer_model_override", - "summarizer_prompt_override": "summarizer_prompt_override", - }, disable_search=True, diverse_first_token=True, enable_search_classifier=True, @@ -464,7 +456,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "reasoning_steps": [ { "thought": "thought", - "type": "web_search", "agent_progress": { "action": "action", "screenshot": "screenshot", @@ -492,6 +483,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ] }, "file_attachment_search": {"attachment_urls": ["string"]}, + "type": "type", "web_search": { "search_keywords": ["string"], "search_results": [ @@ -527,10 +519,6 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn best_of=0, country="country", cum_logprobs=True, - debug_params={ - "summarizer_model_override": "summarizer_model_override", - "summarizer_prompt_override": "summarizer_prompt_override", - }, disable_search=True, diverse_first_token=True, enable_search_classifier=True, @@ -672,7 +660,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "reasoning_steps": [ { "thought": "thought", - "type": "web_search", "agent_progress": { "action": "action", "screenshot": "screenshot", @@ -700,6 +687,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ] }, "file_attachment_search": {"attachment_urls": ["string"]}, + "type": "type", "web_search": { "search_keywords": ["string"], "search_results": [ @@ -736,10 +724,6 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn best_of=0, country="country", cum_logprobs=True, - debug_params={ - "summarizer_model_override": "summarizer_model_override", - "summarizer_prompt_override": "summarizer_prompt_override", - }, disable_search=True, diverse_first_token=True, enable_search_classifier=True,