Skip to content

Commit aafc5a7

Browse files
authored
Merge pull request #18 from perplexityai/release-please--branches--main--changes--next
2 parents 95f2d67 + 29e9fdd commit aafc5a7

File tree

7 files changed

+225
-179
lines changed

7 files changed

+225
-179
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.19.0"
2+
".": "0.19.1"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 5
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-5d4ba4296d72d87995a2189a991e710a77b4b73cc275ad03d8a0eec245cf55db.yml
33
openapi_spec_hash: 5d29546ef1490dda18cda8ca97cd665e
4-
config_hash: 4e2c5b7ad4caa07a2ac1af091ecf6c9c
4+
config_hash: 5b10428c82f4119aa4837f03046d0e5c

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 0.19.1 (2025-10-31)
4+
5+
Full Changelog: [v0.19.0...v0.19.1](https://github.com/perplexityai/perplexity-py/compare/v0.19.0...v0.19.1)
6+
7+
### Bug Fixes
8+
9+
* **client:** close streams without requiring full consumption ([2d7b697](https://github.com/perplexityai/perplexity-py/commit/2d7b697dc5fce75416c4e770dc6c086bf0e7ec2a))
10+
11+
12+
### Chores
13+
14+
* **internal/tests:** avoid race condition with implicit client cleanup ([5eb163f](https://github.com/perplexityai/perplexity-py/commit/5eb163fcff3a0f0bd9ecbc87407627e044535fee))
15+
316
## 0.19.0 (2025-10-30)
417

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "perplexityai"
3-
version = "0.19.0"
3+
version = "0.19.1"
44
description = "The official Python library for the perplexity API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/perplexity/_streaming.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ def __stream__(self) -> Iterator[_T]:
7676
if sse.event is None:
7777
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
7878

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

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

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

166164
async def __aenter__(self) -> Self:
167165
return self

src/perplexity/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "perplexity"
4-
__version__ = "0.19.0" # x-release-please-version
4+
__version__ = "0.19.1" # x-release-please-version

0 commit comments

Comments
 (0)