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.19.0"
".": "0.19.1"
}
2 changes: 1 addition & 1 deletion .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-5d4ba4296d72d87995a2189a991e710a77b4b73cc275ad03d8a0eec245cf55db.yml
openapi_spec_hash: 5d29546ef1490dda18cda8ca97cd665e
config_hash: 4e2c5b7ad4caa07a2ac1af091ecf6c9c
config_hash: 5b10428c82f4119aa4837f03046d0e5c
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.19.1 (2025-10-31)

Full Changelog: [v0.19.0...v0.19.1](https://github.com/perplexityai/perplexity-py/compare/v0.19.0...v0.19.1)

### Bug Fixes

* **client:** close streams without requiring full consumption ([2d7b697](https://github.com/perplexityai/perplexity-py/commit/2d7b697dc5fce75416c4e770dc6c086bf0e7ec2a))


### Chores

* **internal/tests:** avoid race condition with implicit client cleanup ([5eb163f](https://github.com/perplexityai/perplexity-py/commit/5eb163fcff3a0f0bd9ecbc87407627e044535fee))

## 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)
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.19.0"
version = "0.19.1"
description = "The official Python library for the perplexity API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
10 changes: 4 additions & 6 deletions src/perplexity/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ def __stream__(self) -> Iterator[_T]:
if sse.event is None:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
response.close()

def __enter__(self) -> Self:
return self
Expand Down Expand Up @@ -159,9 +158,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
if sse.event is None:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
async for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
await response.aclose()

async def __aenter__(self) -> Self:
return self
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.19.0" # x-release-please-version
__version__ = "0.19.1" # x-release-please-version
Loading