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.17.1"
".": "0.18.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-cf9f981e30f8c9739f337a8b20436cebdbf35fffc70d6db5a09ec5a3b68cddef.yml
openapi_spec_hash: d0cdcfdde0a0046e6451305475060748
config_hash: 29552caca3e91432ed1a14f4a38487cc
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-335f0ceddae39ba77e5abf8b2b72691a43174b25c2ec897cd7779db8d1524820.yml
openapi_spec_hash: e34fc7a3c97b61c7aded4df4774f298e
config_hash: 4e2c5b7ad4caa07a2ac1af091ecf6c9c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 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)

### Features

* **api:** manual updates ([7a08c95](https://github.com/perplexityai/perplexity-py/commit/7a08c95ea7f9a04004153aac6cfd78022a68fd11))

## 0.17.1 (2025-10-18)

Full Changelog: [v0.17.0...v0.17.1](https://github.com/perplexityai/perplexity-py/compare/v0.17.0...v0.17.1)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ client.with_options(max_retries=5).chat.completions.create(

### Timeouts

By default requests time out after 1 minute. You can configure this with a `timeout` option,
By default requests time out after 15 minutes. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from perplexity import Perplexity

# Configure the default for all requests:
client = Perplexity(
# 20 seconds (default is 1 minute)
# 20 seconds (default is 15 minutes)
timeout=20.0,
)

Expand Down
24 changes: 12 additions & 12 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ Methods:

- <code title="post /chat/completions">client.chat.completions.<a href="./src/perplexity/resources/chat/completions.py">create</a>(\*\*<a href="src/perplexity/types/chat/completion_create_params.py">params</a>) -> <a href="./src/perplexity/types/stream_chunk.py">StreamChunk</a></code>

# Search

Types:

```python
from perplexity.types import SearchCreateResponse
```

Methods:

- <code title="post /search">client.search.<a href="./src/perplexity/resources/search.py">create</a>(\*\*<a href="src/perplexity/types/search_create_params.py">params</a>) -> <a href="./src/perplexity/types/search_create_response.py">SearchCreateResponse</a></code>

# Async

## Chat
Expand All @@ -45,15 +57,3 @@ Methods:
- <code title="post /async/chat/completions">client.async*.chat.completions.<a href="./src/perplexity/resources/async*/chat/completions.py">create</a>(\*\*<a href="src/perplexity/types/async_/chat/completion_create_params.py">params</a>) -> <a href="./src/perplexity/types/async_/chat/completion_create_response.py">CompletionCreateResponse</a></code>
- <code title="get /async/chat/completions">client.async*.chat.completions.<a href="./src/perplexity/resources/async*/chat/completions.py">list</a>() -> <a href="./src/perplexity/types/async_/chat/completion_list_response.py">CompletionListResponse</a></code>
- <code title="get /async/chat/completions/{api_request}">client.async*.chat.completions.<a href="./src/perplexity/resources/async*/chat/completions.py">get</a>(api*request, \*\*<a href="src/perplexity/types/async*/chat/completion*get_params.py">params</a>) -> <a href="./src/perplexity/types/async*/chat/completion_get_response.py">CompletionGetResponse</a></code>

# Search

Types:

```python
from perplexity.types import SearchCreateResponse
```

Methods:

- <code title="post /search">client.search.<a href="./src/perplexity/resources/search.py">create</a>(\*\*<a href="src/perplexity/types/search_create_params.py">params</a>) -> <a href="./src/perplexity/types/search_create_response.py">SearchCreateResponse</a></code>
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.17.1"
version = "0.18.0"
description = "The official Python library for the perplexity API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
16 changes: 8 additions & 8 deletions src/perplexity/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@

class Perplexity(SyncAPIClient):
chat: chat.ChatResource
async_: async_.AsyncResource
search: search.SearchResource
async_: async_.AsyncResource
with_raw_response: PerplexityWithRawResponse
with_streaming_response: PerplexityWithStreamedResponse

Expand Down Expand Up @@ -108,8 +108,8 @@ def __init__(
self._default_stream_cls = Stream

self.chat = chat.ChatResource(self)
self.async_ = async_.AsyncResource(self)
self.search = search.SearchResource(self)
self.async_ = async_.AsyncResource(self)
self.with_raw_response = PerplexityWithRawResponse(self)
self.with_streaming_response = PerplexityWithStreamedResponse(self)

Expand Down Expand Up @@ -220,8 +220,8 @@ def _make_status_error(

class AsyncPerplexity(AsyncAPIClient):
chat: chat.AsyncChatResource
async_: async_.AsyncAsyncResource
search: search.AsyncSearchResource
async_: async_.AsyncAsyncResource
with_raw_response: AsyncPerplexityWithRawResponse
with_streaming_response: AsyncPerplexityWithStreamedResponse

Expand Down Expand Up @@ -282,8 +282,8 @@ def __init__(
self._default_stream_cls = AsyncStream

self.chat = chat.AsyncChatResource(self)
self.async_ = async_.AsyncAsyncResource(self)
self.search = search.AsyncSearchResource(self)
self.async_ = async_.AsyncAsyncResource(self)
self.with_raw_response = AsyncPerplexityWithRawResponse(self)
self.with_streaming_response = AsyncPerplexityWithStreamedResponse(self)

Expand Down Expand Up @@ -395,29 +395,29 @@ def _make_status_error(
class PerplexityWithRawResponse:
def __init__(self, client: Perplexity) -> None:
self.chat = chat.ChatResourceWithRawResponse(client.chat)
self.async_ = async_.AsyncResourceWithRawResponse(client.async_)
self.search = search.SearchResourceWithRawResponse(client.search)
self.async_ = async_.AsyncResourceWithRawResponse(client.async_)


class AsyncPerplexityWithRawResponse:
def __init__(self, client: AsyncPerplexity) -> None:
self.chat = chat.AsyncChatResourceWithRawResponse(client.chat)
self.async_ = async_.AsyncAsyncResourceWithRawResponse(client.async_)
self.search = search.AsyncSearchResourceWithRawResponse(client.search)
self.async_ = async_.AsyncAsyncResourceWithRawResponse(client.async_)


class PerplexityWithStreamedResponse:
def __init__(self, client: Perplexity) -> None:
self.chat = chat.ChatResourceWithStreamingResponse(client.chat)
self.async_ = async_.AsyncResourceWithStreamingResponse(client.async_)
self.search = search.SearchResourceWithStreamingResponse(client.search)
self.async_ = async_.AsyncResourceWithStreamingResponse(client.async_)


class AsyncPerplexityWithStreamedResponse:
def __init__(self, client: AsyncPerplexity) -> None:
self.chat = chat.AsyncChatResourceWithStreamingResponse(client.chat)
self.async_ = async_.AsyncAsyncResourceWithStreamingResponse(client.async_)
self.search = search.AsyncSearchResourceWithStreamingResponse(client.search)
self.async_ = async_.AsyncAsyncResourceWithStreamingResponse(client.async_)


Client = Perplexity
Expand Down
4 changes: 2 additions & 2 deletions src/perplexity/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
OVERRIDE_CAST_TO_HEADER = "____stainless_override_cast_to"

# default timeout is 1 minute
DEFAULT_TIMEOUT = httpx.Timeout(timeout=60, connect=5.0)
# default timeout is 15 minutes
DEFAULT_TIMEOUT = httpx.Timeout(timeout=900, connect=5.0)
DEFAULT_MAX_RETRIES = 2
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)

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.17.1" # x-release-please-version
__version__ = "0.18.0" # x-release-please-version
12 changes: 6 additions & 6 deletions src/perplexity/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
"AsyncChatResourceWithRawResponse",
"ChatResourceWithStreamingResponse",
"AsyncChatResourceWithStreamingResponse",
"AsyncResource",
"AsyncAsyncResource",
"AsyncResourceWithRawResponse",
"AsyncAsyncResourceWithRawResponse",
"AsyncResourceWithStreamingResponse",
"AsyncAsyncResourceWithStreamingResponse",
"SearchResource",
"AsyncSearchResource",
"SearchResourceWithRawResponse",
"AsyncSearchResourceWithRawResponse",
"SearchResourceWithStreamingResponse",
"AsyncSearchResourceWithStreamingResponse",
"AsyncResource",
"AsyncAsyncResource",
"AsyncResourceWithRawResponse",
"AsyncAsyncResourceWithRawResponse",
"AsyncResourceWithStreamingResponse",
"AsyncAsyncResourceWithStreamingResponse",
]