Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.39.0"
".": "0.40.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/perplexity/_version.py
Original file line number Diff line number Diff line change
@@ -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
74 changes: 74 additions & 0 deletions src/perplexity/resources/responses/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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,
},
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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,
},
Expand Down
16 changes: 16 additions & 0 deletions src/perplexity/types/response_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down
8 changes: 8 additions & 0 deletions tests/api_resources/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -48,6 +49,7 @@ def test_method_create_with_all_params_overload_1(self, client: Perplexity) -> N
"strict": True,
},
},
store=True,
stream=False,
tools=[
{
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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=[
{
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down