diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1b5dc40..0a40b9d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.39.0" + ".": "0.40.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d04caa1..8659912 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/perplexity-ai/perplexity-a48f6cfc0c2120ede5bd103b3c7fce20079d5a8baece7dad3ddaf98955309329.yml -openapi_spec_hash: 5f4746838a4a9455b5413bb3f1a01b84 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai/perplexity-f15eee99fec8579d1a543c4dfdc74f7633cc8e82004634be302f9c053cdc3934.yml +openapi_spec_hash: 5fe9895246acf0b07b2283b938a018fe config_hash: 3f1487a29a16f85810ba4d77134da232 diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cca3fb..7751864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.40.0 (2026-07-09) + +Full Changelog: [v0.39.0...v0.40.0](https://github.com/perplexityai/perplexity-py/compare/v0.39.0...v0.40.0) + +### Features + +* **api:** manual updates ([07c9724](https://github.com/perplexityai/perplexity-py/commit/07c9724ab2a3c97386eacc43758ae0057a8b83e9)) + ## 0.39.0 (2026-07-02) Full Changelog: [v0.38.0...v0.39.0](https://github.com/perplexityai/perplexity-py/compare/v0.38.0...v0.39.0) diff --git a/pyproject.toml b/pyproject.toml index 29b8bf3..636d54b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "perplexityai" -version = "0.39.0" +version = "0.40.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 7ca943f..0561cde 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.39.0" # x-release-please-version +__version__ = "0.40.0" # x-release-please-version diff --git a/src/perplexity/resources/responses/responses.py b/src/perplexity/resources/responses/responses.py index cec1a10..d70a05c 100644 --- a/src/perplexity/resources/responses/responses.py +++ b/src/perplexity/resources/responses/responses.py @@ -74,8 +74,10 @@ def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, stream: Literal[False] | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -118,8 +120,17 @@ def create( model with system prompt and search parameters. Required if model is not provided. + previous_response_id: OpenAI-compatible previous response id for multi-turn response chains. When set, + the new response continues from the completed prior response using its durable + continuation snapshot. The prior response must belong to the same account and + have completed. + response_format: Specifies the desired output format for the model response + store: OpenAI-compatible storage toggle. When false, the response is hidden from later + retrieve calls, and the echoed response reports `store: false`. It can still be + used as a `previous_response_id` continuation source. + stream: If true, returns SSE stream instead of JSON tools: Tools available to the model @@ -148,8 +159,10 @@ def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -193,8 +206,17 @@ def create( model with system prompt and search parameters. Required if model is not provided. + previous_response_id: OpenAI-compatible previous response id for multi-turn response chains. When set, + the new response continues from the completed prior response using its durable + continuation snapshot. The prior response must belong to the same account and + have completed. + response_format: Specifies the desired output format for the model response + store: OpenAI-compatible storage toggle. When false, the response is hidden from later + retrieve calls, and the echoed response reports `store: false`. It can still be + used as a `previous_response_id` continuation source. + tools: Tools available to the model extra_headers: Send extra headers @@ -221,8 +243,10 @@ def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -266,8 +290,17 @@ def create( model with system prompt and search parameters. Required if model is not provided. + previous_response_id: OpenAI-compatible previous response id for multi-turn response chains. When set, + the new response continues from the completed prior response using its durable + continuation snapshot. The prior response must belong to the same account and + have completed. + response_format: Specifies the desired output format for the model response + store: OpenAI-compatible storage toggle. When false, the response is hidden from later + retrieve calls, and the echoed response reports `store: false`. It can still be + used as a `previous_response_id` continuation source. + tools: Tools available to the model extra_headers: Send extra headers @@ -293,8 +326,10 @@ def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, stream: Literal[False] | Literal[True] | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -317,8 +352,10 @@ def create( "model": model, "models": models, "preset": preset, + "previous_response_id": previous_response_id, "reasoning": reasoning, "response_format": response_format, + "store": store, "stream": stream, "tools": tools, }, @@ -406,8 +443,10 @@ async def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, stream: Literal[False] | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -450,8 +489,17 @@ async def create( model with system prompt and search parameters. Required if model is not provided. + previous_response_id: OpenAI-compatible previous response id for multi-turn response chains. When set, + the new response continues from the completed prior response using its durable + continuation snapshot. The prior response must belong to the same account and + have completed. + response_format: Specifies the desired output format for the model response + store: OpenAI-compatible storage toggle. When false, the response is hidden from later + retrieve calls, and the echoed response reports `store: false`. It can still be + used as a `previous_response_id` continuation source. + stream: If true, returns SSE stream instead of JSON tools: Tools available to the model @@ -480,8 +528,10 @@ async def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -525,8 +575,17 @@ async def create( model with system prompt and search parameters. Required if model is not provided. + previous_response_id: OpenAI-compatible previous response id for multi-turn response chains. When set, + the new response continues from the completed prior response using its durable + continuation snapshot. The prior response must belong to the same account and + have completed. + response_format: Specifies the desired output format for the model response + store: OpenAI-compatible storage toggle. When false, the response is hidden from later + retrieve calls, and the echoed response reports `store: false`. It can still be + used as a `previous_response_id` continuation source. + tools: Tools available to the model extra_headers: Send extra headers @@ -553,8 +612,10 @@ async def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -598,8 +659,17 @@ async def create( model with system prompt and search parameters. Required if model is not provided. + previous_response_id: OpenAI-compatible previous response id for multi-turn response chains. When set, + the new response continues from the completed prior response using its durable + continuation snapshot. The prior response must belong to the same account and + have completed. + response_format: Specifies the desired output format for the model response + store: OpenAI-compatible storage toggle. When false, the response is hidden from later + retrieve calls, and the echoed response reports `store: false`. It can still be + used as a `previous_response_id` continuation source. + tools: Tools available to the model extra_headers: Send extra headers @@ -625,8 +695,10 @@ async def create( model: str | Omit = omit, models: SequenceNotStr[str] | Omit = omit, preset: str | Omit = omit, + previous_response_id: str | Omit = omit, reasoning: response_create_params.Reasoning | Omit = omit, response_format: ResponseFormat | Omit = omit, + store: bool | Omit = omit, stream: Literal[False] | Literal[True] | Omit = omit, tools: Iterable[response_create_params.Tool] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -649,8 +721,10 @@ async def create( "model": model, "models": models, "preset": preset, + "previous_response_id": previous_response_id, "reasoning": reasoning, "response_format": response_format, + "store": store, "stream": stream, "tools": tools, }, diff --git a/src/perplexity/types/response_create_params.py b/src/perplexity/types/response_create_params.py index 8ca5e38..1e7bbcf 100644 --- a/src/perplexity/types/response_create_params.py +++ b/src/perplexity/types/response_create_params.py @@ -76,11 +76,27 @@ class ResponseCreateParamsBase(TypedDict, total=False): provided. """ + previous_response_id: str + """OpenAI-compatible previous response id for multi-turn response chains. + + When set, the new response continues from the completed prior response using its + durable continuation snapshot. The prior response must belong to the same + account and have completed. + """ + reasoning: Reasoning response_format: ResponseFormat """Specifies the desired output format for the model response""" + store: bool + """OpenAI-compatible storage toggle. + + When false, the response is hidden from later retrieve calls, and the echoed + response reports `store: false`. It can still be used as a + `previous_response_id` continuation source. + """ + tools: Iterable[Tool] """Tools available to the model""" diff --git a/tests/api_resources/test_responses.py b/tests/api_resources/test_responses.py index f3969d8..db5bfdc 100644 --- a/tests/api_resources/test_responses.py +++ b/tests/api_resources/test_responses.py @@ -38,6 +38,7 @@ def test_method_create_with_all_params_overload_1(self, client: Perplexity) -> N model="model", models=["string"], preset="preset", + previous_response_id="previous_response_id", reasoning={"effort": "minimal"}, response_format={ "type": "json_schema", @@ -48,6 +49,7 @@ def test_method_create_with_all_params_overload_1(self, client: Perplexity) -> N "strict": True, }, }, + store=True, stream=False, tools=[ { @@ -124,6 +126,7 @@ def test_method_create_with_all_params_overload_2(self, client: Perplexity) -> N model="model", models=["string"], preset="preset", + previous_response_id="previous_response_id", reasoning={"effort": "minimal"}, response_format={ "type": "json_schema", @@ -134,6 +137,7 @@ def test_method_create_with_all_params_overload_2(self, client: Perplexity) -> N "strict": True, }, }, + store=True, tools=[ { "type": "web_search", @@ -256,6 +260,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn model="model", models=["string"], preset="preset", + previous_response_id="previous_response_id", reasoning={"effort": "minimal"}, response_format={ "type": "json_schema", @@ -266,6 +271,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "strict": True, }, }, + store=True, stream=False, tools=[ { @@ -342,6 +348,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn model="model", models=["string"], preset="preset", + previous_response_id="previous_response_id", reasoning={"effort": "minimal"}, response_format={ "type": "json_schema", @@ -352,6 +359,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "strict": True, }, }, + store=True, tools=[ { "type": "web_search",