relaxai 0.5.2__py3-none-any.whl → 0.5.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
relaxai/_streaming.py CHANGED
@@ -57,9 +57,8 @@ class Stream(Generic[_T]):
57
57
  for sse in iterator:
58
58
  yield process_data(data=sse.json(), cast_to=cast_to, response=response)
59
59
 
60
- # Ensure the entire stream is consumed
61
- for _sse in iterator:
62
- ...
60
+ # As we might not fully consume the response stream, we need to close it explicitly
61
+ response.close()
63
62
 
64
63
  def __enter__(self) -> Self:
65
64
  return self
@@ -121,9 +120,8 @@ class AsyncStream(Generic[_T]):
121
120
  async for sse in iterator:
122
121
  yield process_data(data=sse.json(), cast_to=cast_to, response=response)
123
122
 
124
- # Ensure the entire stream is consumed
125
- async for _sse in iterator:
126
- ...
123
+ # As we might not fully consume the response stream, we need to close it explicitly
124
+ await response.aclose()
127
125
 
128
126
  async def __aenter__(self) -> Self:
129
127
  return self
relaxai/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "relaxai"
4
- __version__ = "0.5.2" # x-release-please-version
4
+ __version__ = "0.5.4" # x-release-please-version
@@ -8,7 +8,7 @@ import httpx
8
8
 
9
9
  from ..types import deep_research_create_params
10
10
  from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
11
- from .._utils import maybe_transform, async_maybe_transform
11
+ from .._utils import is_given, maybe_transform, async_maybe_transform
12
12
  from .._compat import cached_property
13
13
  from .._resource import SyncAPIResource, AsyncAPIResource
14
14
  from .._response import (
@@ -17,6 +17,7 @@ from .._response import (
17
17
  async_to_raw_response_wrapper,
18
18
  async_to_streamed_response_wrapper,
19
19
  )
20
+ from .._constants import DEFAULT_TIMEOUT
20
21
  from .._base_client import make_request_options
21
22
  from ..types.stream_options_param import StreamOptionsParam
22
23
  from ..types.deepresearch_response import DeepresearchResponse
@@ -78,6 +79,8 @@ class DeepResearchResource(SyncAPIResource):
78
79
 
79
80
  timeout: Override the client-level default timeout for this request, in seconds
80
81
  """
82
+ if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
83
+ timeout = 600
81
84
  return self._post(
82
85
  "/v1/deep-research",
83
86
  body=maybe_transform(
@@ -156,6 +159,8 @@ class AsyncDeepResearchResource(AsyncAPIResource):
156
159
 
157
160
  timeout: Override the client-level default timeout for this request, in seconds
158
161
  """
162
+ if not is_given(timeout) and self._client.timeout == DEFAULT_TIMEOUT:
163
+ timeout = 600
159
164
  return await self._post(
160
165
  "/v1/deep-research",
161
166
  body=await async_maybe_transform(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: relaxai
3
- Version: 0.5.2
3
+ Version: 0.5.4
4
4
  Summary: The official Python library for the relaxai API
5
5
  Project-URL: Homepage, https://github.com/relax-ai/python-sdk
6
6
  Project-URL: Repository, https://github.com/relax-ai/python-sdk
@@ -30,7 +30,7 @@ Requires-Dist: sniffio
30
30
  Requires-Dist: typing-extensions<5,>=4.10
31
31
  Provides-Extra: aiohttp
32
32
  Requires-Dist: aiohttp; extra == 'aiohttp'
33
- Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
34
34
  Description-Content-Type: text/markdown
35
35
 
36
36
  # Relaxai Python API library
@@ -9,9 +9,9 @@ relaxai/_models.py,sha256=lKnskYPONAWDvWo8tmbbVk7HmG7UOsI0Nve0vSMmkRc,30452
9
9
  relaxai/_qs.py,sha256=craIKyvPktJ94cvf9zn8j8ekG9dWJzhWv0ob34lIOv4,4828
10
10
  relaxai/_resource.py,sha256=v7qxjafEaUaEfecj54WhuhW2hupVzM8Os0EIHVRmbkc,1106
11
11
  relaxai/_response.py,sha256=URFVS4ivxSoLsvosTN0Rc3f5vbBBb0DIB4Eh2XPGa_Q,28794
12
- relaxai/_streaming.py,sha256=Nr4O_q1hh35alNVqo46KKf9ZTbRp-IoXjGFCCNJC1fA,10104
12
+ relaxai/_streaming.py,sha256=GWkI4kJCADxhcrfdLdXo4tTaatOlixsr3v3cC5aeVYI,10153
13
13
  relaxai/_types.py,sha256=v5coMcqP3kIeECx9ks-aaxiodh2l0UEKv6UI4creii4,7237
14
- relaxai/_version.py,sha256=svd-bh0pKXXETQobMzg46j5yTdeXt2xCe_J206pc2Tg,159
14
+ relaxai/_version.py,sha256=EZjrwLljGSXYn6-hmBRT3sIj322Z7buYAGBnZbgSX8E,159
15
15
  relaxai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  relaxai/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
17
17
  relaxai/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
@@ -28,7 +28,7 @@ relaxai/_utils/_utils.py,sha256=0dDqauUbVZEXV0NVl7Bwu904Wwo5eyFCZpQThhFNhyA,1225
28
28
  relaxai/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
29
29
  relaxai/resources/__init__.py,sha256=PN55gCB7h9TokDnEC4NT3jPj17828geZDkMh6wv9uKE,2444
30
30
  relaxai/resources/chat.py,sha256=yeDuAAJk3dW1ysw7nvO2euzPzcjeHAxT-Y-9BI5l40Y,13053
31
- relaxai/resources/deep_research.py,sha256=87098Z1XBBd52foI-31x7pYU09BenVD0VoM5lIlRyc8,8474
31
+ relaxai/resources/deep_research.py,sha256=0mpRHa62GIdR2IhHM0AHd7N-jvY2bMEEcy18C88y5oo,8733
32
32
  relaxai/resources/embeddings.py,sha256=BpG5jmG2O-hVnRawd834JQLvKeC7rzvfaOAyxXapGbg,6998
33
33
  relaxai/resources/models.py,sha256=Zkp7vxtB5xp2vDHOsWB2XQhcj-52AAusvFQAiS2aVWE,7856
34
34
  relaxai/resources/tools.py,sha256=n6iE8e-KtqGJ-YaiRHdYUTlVzi9AOc4vd9ioP7jE5go,6411
@@ -55,7 +55,7 @@ relaxai/types/shared/__init__.py,sha256=rVHWDutDMA_BYQSHahIzfwcaDAwE3zyBvTiPRI1l
55
55
  relaxai/types/shared/openai_completion_tokens_details.py,sha256=kjDBsTKvzhw-8UA3t7CQ6qvAo4Lmnup5VEFU2QzBynw,338
56
56
  relaxai/types/shared/openai_prompt_tokens_details.py,sha256=wdPCsobx-VBw3MgfSCY4HXrGnMtw6YXiepKpXw1kZAE,253
57
57
  relaxai/types/shared/openai_usage.py,sha256=W-mht7UXuWne_eFXCBXHpf2HEsjzfXo2jPXOdKNEdbQ,513
58
- relaxai-0.5.2.dist-info/METADATA,sha256=krJT1itRLyDNqbI_3q2UHk6JcyuZQUWMkS5D8OmCuG4,15304
59
- relaxai-0.5.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
60
- relaxai-0.5.2.dist-info/licenses/LICENSE,sha256=B0u5zBqmaNCfIZooH665f2J7yFqMmSjQxZtnJhCuID8,11337
61
- relaxai-0.5.2.dist-info/RECORD,,
58
+ relaxai-0.5.4.dist-info/METADATA,sha256=o29d1MJE0ZXz0B62UkkwV3gAN4D5kN97sUouDhsp-qY,15304
59
+ relaxai-0.5.4.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
60
+ relaxai-0.5.4.dist-info/licenses/LICENSE,sha256=B0u5zBqmaNCfIZooH665f2J7yFqMmSjQxZtnJhCuID8,11337
61
+ relaxai-0.5.4.dist-info/RECORD,,