relaxai 0.0.1__py3-none-any.whl → 0.2.0__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.

Potentially problematic release.


This version of relaxai might be problematic. Click here for more details.

Files changed (31) hide show
  1. relaxai/_base_client.py +12 -2
  2. relaxai/_client.py +77 -40
  3. relaxai/_files.py +4 -4
  4. relaxai/_models.py +31 -7
  5. relaxai/_version.py +1 -1
  6. relaxai/resources/__init__.py +0 -14
  7. relaxai/resources/chat.py +46 -21
  8. relaxai/resources/embeddings.py +18 -18
  9. relaxai/resources/models.py +57 -57
  10. relaxai/types/__init__.py +11 -6
  11. relaxai/types/chat_completion_message.py +29 -3
  12. relaxai/types/chat_completion_message_param.py +29 -4
  13. relaxai/types/{chat_create_completion_response.py → chat_completion_response.py} +4 -4
  14. relaxai/types/chat_create_completion_params.py +62 -10
  15. relaxai/types/{embedding_create_params.py → embedding_create_embedding_params.py} +2 -2
  16. relaxai/types/{embedding_create_response.py → embedding_response.py} +4 -4
  17. relaxai/types/function_definition_param.py +6 -2
  18. relaxai/types/{health_check_response.py → health_response.py} +2 -2
  19. relaxai/types/{model_list_response.py → model_list.py} +2 -2
  20. relaxai/types/shared/__init__.py +5 -0
  21. relaxai/types/shared/openai_completion_tokens_details.py +15 -0
  22. relaxai/types/shared/openai_prompt_tokens_details.py +11 -0
  23. relaxai/types/shared/openai_usage.py +19 -0
  24. relaxai/types/stream_options_param.py +11 -0
  25. {relaxai-0.0.1.dist-info → relaxai-0.2.0.dist-info}/METADATA +49 -43
  26. relaxai-0.2.0.dist-info/RECORD +53 -0
  27. relaxai/resources/health.py +0 -134
  28. relaxai/types/usage.py +0 -33
  29. relaxai-0.0.1.dist-info/RECORD +0 -50
  30. {relaxai-0.0.1.dist-info → relaxai-0.2.0.dist-info}/WHEEL +0 -0
  31. {relaxai-0.0.1.dist-info → relaxai-0.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -7,10 +7,10 @@ from pydantic import Field as FieldInfo
7
7
  from .model import Model
8
8
  from .._models import BaseModel
9
9
 
10
- __all__ = ["ModelListResponse"]
10
+ __all__ = ["ModelList"]
11
11
 
12
12
 
13
- class ModelListResponse(BaseModel):
13
+ class ModelList(BaseModel):
14
14
  data: List[Model]
15
15
 
16
16
  http_header: Dict[str, List[str]] = FieldInfo(alias="httpHeader")
@@ -0,0 +1,5 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .openai_usage import OpenAIUsage as OpenAIUsage
4
+ from .openai_prompt_tokens_details import OpenAIPromptTokensDetails as OpenAIPromptTokensDetails
5
+ from .openai_completion_tokens_details import OpenAICompletionTokensDetails as OpenAICompletionTokensDetails
@@ -0,0 +1,15 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["OpenAICompletionTokensDetails"]
6
+
7
+
8
+ class OpenAICompletionTokensDetails(BaseModel):
9
+ accepted_prediction_tokens: int
10
+
11
+ audio_tokens: int
12
+
13
+ reasoning_tokens: int
14
+
15
+ rejected_prediction_tokens: int
@@ -0,0 +1,11 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+
5
+ __all__ = ["OpenAIPromptTokensDetails"]
6
+
7
+
8
+ class OpenAIPromptTokensDetails(BaseModel):
9
+ audio_tokens: int
10
+
11
+ cached_tokens: int
@@ -0,0 +1,19 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from ..._models import BaseModel
4
+ from .openai_prompt_tokens_details import OpenAIPromptTokensDetails
5
+ from .openai_completion_tokens_details import OpenAICompletionTokensDetails
6
+
7
+ __all__ = ["OpenAIUsage"]
8
+
9
+
10
+ class OpenAIUsage(BaseModel):
11
+ completion_tokens: int
12
+
13
+ completion_tokens_details: OpenAICompletionTokensDetails
14
+
15
+ prompt_tokens: int
16
+
17
+ prompt_tokens_details: OpenAIPromptTokensDetails
18
+
19
+ total_tokens: int
@@ -0,0 +1,11 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import TypedDict
6
+
7
+ __all__ = ["StreamOptionsParam"]
8
+
9
+
10
+ class StreamOptionsParam(TypedDict, total=False):
11
+ include_usage: bool
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: relaxai
3
- Version: 0.0.1
3
+ Version: 0.2.0
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
7
- Author-email: Relaxai <hello@drelax.ai>
7
+ Author-email: Relaxai <hello@relax.ai>
8
8
  License: Apache-2.0
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: Apache Software License
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
23
  Classifier: Typing :: Typed
23
24
  Requires-Python: >=3.8
@@ -29,12 +30,13 @@ Requires-Dist: sniffio
29
30
  Requires-Dist: typing-extensions<5,>=4.10
30
31
  Provides-Extra: aiohttp
31
32
  Requires-Dist: aiohttp; extra == 'aiohttp'
32
- Requires-Dist: httpx-aiohttp>=0.1.6; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
33
34
  Description-Content-Type: text/markdown
34
35
 
35
36
  # Relaxai Python API library
36
37
 
37
- [![PyPI version](https://github.com/relax-ai/python-sdk/tree/main/<https://img.shields.io/pypi/v/relaxai.svg?label=pypi%20(stable)>)](https://pypi.org/project/relaxai/)
38
+ <!-- prettier-ignore -->
39
+ [![PyPI version](https://img.shields.io/pypi/v/relaxai.svg?label=pypi%20(stable))](https://pypi.org/project/relaxai/)
38
40
 
39
41
  The Relaxai Python library provides convenient access to the Relaxai REST API from any Python 3.8+
40
42
  application. The library includes type definitions for all request params and response fields,
@@ -65,16 +67,17 @@ client = Relaxai(
65
67
  api_key=os.environ.get("RELAXAI_API_KEY"), # This is the default and can be omitted
66
68
  )
67
69
 
68
- response = client.chat.create_completion(
70
+ chat_completion_response = client.chat.create_completion(
69
71
  messages=[
70
72
  {
71
- "multi_content": [{}],
72
- "role": "role",
73
+ "role": "user",
74
+ "content": "Hello, how are you?",
73
75
  }
74
76
  ],
75
- model="model",
77
+ model="Llama-4-Maverick-17B-128E",
78
+ max_tokens=100,
76
79
  )
77
- print(response.id)
80
+ print(chat_completion_response.choices)
78
81
  ```
79
82
 
80
83
  While you can provide an `api_key` keyword argument,
@@ -97,16 +100,17 @@ client = AsyncRelaxai(
97
100
 
98
101
 
99
102
  async def main() -> None:
100
- response = await client.chat.create_completion(
103
+ chat_completion_response = await client.chat.create_completion(
101
104
  messages=[
102
105
  {
103
- "multi_content": [{}],
104
- "role": "role",
106
+ "role": "user",
107
+ "content": "Hello, how are you?",
105
108
  }
106
109
  ],
107
- model="model",
110
+ model="Llama-4-Maverick-17B-128E",
111
+ max_tokens=100,
108
112
  )
109
- print(response.id)
113
+ print(chat_completion_response.choices)
110
114
 
111
115
 
112
116
  asyncio.run(main())
@@ -128,7 +132,6 @@ pip install relaxai[aiohttp]
128
132
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
129
133
 
130
134
  ```python
131
- import os
132
135
  import asyncio
133
136
  from relaxai import DefaultAioHttpClient
134
137
  from relaxai import AsyncRelaxai
@@ -136,19 +139,20 @@ from relaxai import AsyncRelaxai
136
139
 
137
140
  async def main() -> None:
138
141
  async with AsyncRelaxai(
139
- api_key=os.environ.get("RELAXAI_API_KEY"), # This is the default and can be omitted
142
+ api_key="My API Key",
140
143
  http_client=DefaultAioHttpClient(),
141
144
  ) as client:
142
- response = await client.chat.create_completion(
145
+ chat_completion_response = await client.chat.create_completion(
143
146
  messages=[
144
147
  {
145
- "multi_content": [{}],
146
- "role": "role",
148
+ "role": "user",
149
+ "content": "Hello, how are you?",
147
150
  }
148
151
  ],
149
- model="model",
152
+ model="Llama-4-Maverick-17B-128E",
153
+ max_tokens=100,
150
154
  )
151
- print(response.id)
155
+ print(chat_completion_response.choices)
152
156
 
153
157
 
154
158
  asyncio.run(main())
@@ -172,20 +176,17 @@ from relaxai import Relaxai
172
176
 
173
177
  client = Relaxai()
174
178
 
175
- response = client.chat.create_completion(
179
+ chat_completion_response = client.chat.create_completion(
176
180
  messages=[
177
181
  {
178
- "multi_content": [{}],
182
+ "content": "content",
179
183
  "role": "role",
180
184
  }
181
185
  ],
182
186
  model="model",
183
- prediction={
184
- "content": "content",
185
- "type": "type",
186
- },
187
+ chat_template_kwargs={},
187
188
  )
188
- print(response.prediction)
189
+ print(chat_completion_response.chat_template_kwargs)
189
190
  ```
190
191
 
191
192
  ## Handling errors
@@ -207,11 +208,12 @@ try:
207
208
  client.chat.create_completion(
208
209
  messages=[
209
210
  {
210
- "multi_content": [{}],
211
- "role": "role",
211
+ "role": "user",
212
+ "content": "Hello, how are you?",
212
213
  }
213
214
  ],
214
- model="model",
215
+ model="Llama-4-Maverick-17B-128E",
216
+ max_tokens=100,
215
217
  )
216
218
  except relaxai.APIConnectionError as e:
217
219
  print("The server could not be reached")
@@ -258,11 +260,12 @@ client = Relaxai(
258
260
  client.with_options(max_retries=5).chat.create_completion(
259
261
  messages=[
260
262
  {
261
- "multi_content": [{}],
262
- "role": "role",
263
+ "role": "user",
264
+ "content": "Hello, how are you?",
263
265
  }
264
266
  ],
265
- model="model",
267
+ model="Llama-4-Maverick-17B-128E",
268
+ max_tokens=100,
266
269
  )
267
270
  ```
268
271
 
@@ -289,11 +292,12 @@ client = Relaxai(
289
292
  client.with_options(timeout=5.0).chat.create_completion(
290
293
  messages=[
291
294
  {
292
- "multi_content": [{}],
293
- "role": "role",
295
+ "role": "user",
296
+ "content": "Hello, how are you?",
294
297
  }
295
298
  ],
296
- model="model",
299
+ model="Llama-4-Maverick-17B-128E",
300
+ max_tokens=100,
297
301
  )
298
302
  ```
299
303
 
@@ -337,10 +341,11 @@ from relaxai import Relaxai
337
341
  client = Relaxai()
338
342
  response = client.chat.with_raw_response.create_completion(
339
343
  messages=[{
340
- "multi_content": [{}],
341
- "role": "role",
344
+ "role": "user",
345
+ "content": "Hello, how are you?",
342
346
  }],
343
- model="model",
347
+ model="Llama-4-Maverick-17B-128E",
348
+ max_tokens=100,
344
349
  )
345
350
  print(response.headers.get('X-My-Header'))
346
351
 
@@ -362,11 +367,12 @@ To stream the response body, use `.with_streaming_response` instead, which requi
362
367
  with client.chat.with_streaming_response.create_completion(
363
368
  messages=[
364
369
  {
365
- "multi_content": [{}],
366
- "role": "role",
370
+ "role": "user",
371
+ "content": "Hello, how are you?",
367
372
  }
368
373
  ],
369
- model="model",
374
+ model="Llama-4-Maverick-17B-128E",
375
+ max_tokens=100,
370
376
  ) as response:
371
377
  print(response.headers.get("X-My-Header"))
372
378
 
@@ -0,0 +1,53 @@
1
+ relaxai/__init__.py,sha256=jawpphZN3cZd39n6_t5JS-ypY59otlavNWnrP--HOHU,2587
2
+ relaxai/_base_client.py,sha256=XSTrjOWzbSPTZAECGywIeNj9dtHx3nUf9vUf5uEyxK8,67036
3
+ relaxai/_client.py,sha256=t4e0GFc6ooxAbPTlw4h4LxFfG3woednjoHScsKYyyIU,18179
4
+ relaxai/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
+ relaxai/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
+ relaxai/_exceptions.py,sha256=CPRCoUcv5nQ7_hkZu9WvAFxQM0Mf6_ZCGU8JPY81zpY,3222
7
+ relaxai/_files.py,sha256=KnEzGi_O756MvKyJ4fOCW_u3JhOeWPQ4RsmDvqihDQU,3545
8
+ relaxai/_models.py,sha256=KvjsMfb88XZlFUKVoOxr8OyDj47MhoH2OKqWNEbBhk4,30010
9
+ relaxai/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
+ relaxai/_resource.py,sha256=v7qxjafEaUaEfecj54WhuhW2hupVzM8Os0EIHVRmbkc,1106
11
+ relaxai/_response.py,sha256=URFVS4ivxSoLsvosTN0Rc3f5vbBBb0DIB4Eh2XPGa_Q,28794
12
+ relaxai/_streaming.py,sha256=Nr4O_q1hh35alNVqo46KKf9ZTbRp-IoXjGFCCNJC1fA,10104
13
+ relaxai/_types.py,sha256=hzXV2igITH7hq2g4zoT8DOcWoTygjpuzRT2OUh1-V1w,6198
14
+ relaxai/_version.py,sha256=9fl3mgYPLu0uqEXiNoPv7fkOZwR5JHUzhPyGwMSTqkE,159
15
+ relaxai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ relaxai/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
+ relaxai/_utils/_logs.py,sha256=JN6s4kBek7yKmmZ_YwCsGFuRdVLEaxfgdkCgnJWcFN0,777
18
+ relaxai/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
19
+ relaxai/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
+ relaxai/_utils/_resources_proxy.py,sha256=9_EObM8JvNkCjrPt8cs1fv4Zitbzv6UQjJJA-GKm4Tw,594
21
+ relaxai/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
22
+ relaxai/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
23
+ relaxai/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
24
+ relaxai/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
25
+ relaxai/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
26
+ relaxai/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
+ relaxai/resources/__init__.py,sha256=5FOvNOOZuqlSuikZSCGuw_hSbh_uxDu5n-ABdfAr-eQ,1478
28
+ relaxai/resources/chat.py,sha256=rzG_U3jolLfArwLOVz0zu7nOD6c13MDNra1BFwRJDlU,13515
29
+ relaxai/resources/embeddings.py,sha256=V4yeTPCGwbaJC8xUndpVaqobq6KzvmeiV9TJuq5gSkU,7040
30
+ relaxai/resources/models.py,sha256=zID8M-GHv596jrwYKg22uvxH6Z79uGqwvF4krsO9-Z4,7856
31
+ relaxai/types/__init__.py,sha256=0pxpDpZGPpN1xX8gflH_elHCQOP_njSBGUSDPRRDNDo,1378
32
+ relaxai/types/chat_completion_message.py,sha256=t-dKQxWfqUr8UsX5Fs3NpN9YfRJ5oJvozfZtWn3JF8M,1544
33
+ relaxai/types/chat_completion_message_param.py,sha256=X4oAp6FQwue-SEibwr3KcxhJNQZiaiBhz2Q9mMHY5_M,1485
34
+ relaxai/types/chat_completion_response.py,sha256=II4PjVfW60aa9aX5mApsseDerQVieTlt9BLim2fY_RE,1564
35
+ relaxai/types/chat_create_completion_params.py,sha256=eJk0Pvtk8AkbyPoDQVxuE4b5VD7lN3Xu3vE32wjU5ps,3015
36
+ relaxai/types/content_filter_results.py,sha256=vOaHu4jdGKVX4vqqCZohTYDsKDXlvfh57Ozb_95-c2U,999
37
+ relaxai/types/embedding_create_embedding_params.py,sha256=76aUOwC4LMjfMesJTjrjUh_FzVkDcRe_2rRzMTcdaag,399
38
+ relaxai/types/embedding_response.py,sha256=N7SS9DhAbG5kEWF6RxYc8gl_rUvY9c1mSoT8v4vwahA,549
39
+ relaxai/types/function_call.py,sha256=n_agCO6Vrh5YZH1SZ6GWOV4mk2IFPeHJA_WkZrPGPMw,277
40
+ relaxai/types/function_call_param.py,sha256=X-bQ7vMH7BKrAiweHRGY5fGzddPLkppUOa1R1T5etg0,281
41
+ relaxai/types/function_definition_param.py,sha256=t1P6B-6DqaBnFNEGM_8lQoQtA_hqDdiUwf7D3EXILs8,438
42
+ relaxai/types/health_response.py,sha256=1c2L7g4f7lqwcXgE3rHtGoWfWgZuLPUF8IcEpKzn-6k,190
43
+ relaxai/types/model.py,sha256=Du9lb9dn846N1fPrKtDsPSLczkqnzxVAJPb8GMqyVJ8,764
44
+ relaxai/types/model_list.py,sha256=9lvzYRTBYTVudP9_28Ai0lUfc82eXOmz0qZ_rwCzxIU,364
45
+ relaxai/types/stream_options_param.py,sha256=JEom-Fs3ORSTD86NTan-9ZjlKYfPEvSYXViUhOXPCb0,273
46
+ relaxai/types/shared/__init__.py,sha256=rVHWDutDMA_BYQSHahIzfwcaDAwE3zyBvTiPRI1lSFo,346
47
+ relaxai/types/shared/openai_completion_tokens_details.py,sha256=kjDBsTKvzhw-8UA3t7CQ6qvAo4Lmnup5VEFU2QzBynw,338
48
+ relaxai/types/shared/openai_prompt_tokens_details.py,sha256=wdPCsobx-VBw3MgfSCY4HXrGnMtw6YXiepKpXw1kZAE,253
49
+ relaxai/types/shared/openai_usage.py,sha256=W-mht7UXuWne_eFXCBXHpf2HEsjzfXo2jPXOdKNEdbQ,513
50
+ relaxai-0.2.0.dist-info/METADATA,sha256=tzamjClVP0RD9oGQqM_a0DJgGrGIEnaVQd9968m4Eck,15480
51
+ relaxai-0.2.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
52
+ relaxai-0.2.0.dist-info/licenses/LICENSE,sha256=B0u5zBqmaNCfIZooH665f2J7yFqMmSjQxZtnJhCuID8,11337
53
+ relaxai-0.2.0.dist-info/RECORD,,
@@ -1,134 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- import httpx
6
-
7
- from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8
- from .._compat import cached_property
9
- from .._resource import SyncAPIResource, AsyncAPIResource
10
- from .._response import (
11
- to_raw_response_wrapper,
12
- to_streamed_response_wrapper,
13
- async_to_raw_response_wrapper,
14
- async_to_streamed_response_wrapper,
15
- )
16
- from .._base_client import make_request_options
17
-
18
- __all__ = ["HealthResource", "AsyncHealthResource"]
19
-
20
-
21
- class HealthResource(SyncAPIResource):
22
- @cached_property
23
- def with_raw_response(self) -> HealthResourceWithRawResponse:
24
- """
25
- This property can be used as a prefix for any HTTP method call to return
26
- the raw response object instead of the parsed content.
27
-
28
- For more information, see https://www.github.com/relax-ai/python-sdk#accessing-raw-response-data-eg-headers
29
- """
30
- return HealthResourceWithRawResponse(self)
31
-
32
- @cached_property
33
- def with_streaming_response(self) -> HealthResourceWithStreamingResponse:
34
- """
35
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36
-
37
- For more information, see https://www.github.com/relax-ai/python-sdk#with_streaming_response
38
- """
39
- return HealthResourceWithStreamingResponse(self)
40
-
41
- def check(
42
- self,
43
- *,
44
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
45
- # The extra values given here take precedence over values defined on the client or passed to this method.
46
- extra_headers: Headers | None = None,
47
- extra_query: Query | None = None,
48
- extra_body: Body | None = None,
49
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
50
- ) -> str:
51
- """Check the health of the service."""
52
- return self._get(
53
- "/v1/health",
54
- options=make_request_options(
55
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
56
- ),
57
- cast_to=str,
58
- )
59
-
60
-
61
- class AsyncHealthResource(AsyncAPIResource):
62
- @cached_property
63
- def with_raw_response(self) -> AsyncHealthResourceWithRawResponse:
64
- """
65
- This property can be used as a prefix for any HTTP method call to return
66
- the raw response object instead of the parsed content.
67
-
68
- For more information, see https://www.github.com/relax-ai/python-sdk#accessing-raw-response-data-eg-headers
69
- """
70
- return AsyncHealthResourceWithRawResponse(self)
71
-
72
- @cached_property
73
- def with_streaming_response(self) -> AsyncHealthResourceWithStreamingResponse:
74
- """
75
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
76
-
77
- For more information, see https://www.github.com/relax-ai/python-sdk#with_streaming_response
78
- """
79
- return AsyncHealthResourceWithStreamingResponse(self)
80
-
81
- async def check(
82
- self,
83
- *,
84
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
85
- # The extra values given here take precedence over values defined on the client or passed to this method.
86
- extra_headers: Headers | None = None,
87
- extra_query: Query | None = None,
88
- extra_body: Body | None = None,
89
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
90
- ) -> str:
91
- """Check the health of the service."""
92
- return await self._get(
93
- "/v1/health",
94
- options=make_request_options(
95
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
96
- ),
97
- cast_to=str,
98
- )
99
-
100
-
101
- class HealthResourceWithRawResponse:
102
- def __init__(self, health: HealthResource) -> None:
103
- self._health = health
104
-
105
- self.check = to_raw_response_wrapper(
106
- health.check,
107
- )
108
-
109
-
110
- class AsyncHealthResourceWithRawResponse:
111
- def __init__(self, health: AsyncHealthResource) -> None:
112
- self._health = health
113
-
114
- self.check = async_to_raw_response_wrapper(
115
- health.check,
116
- )
117
-
118
-
119
- class HealthResourceWithStreamingResponse:
120
- def __init__(self, health: HealthResource) -> None:
121
- self._health = health
122
-
123
- self.check = to_streamed_response_wrapper(
124
- health.check,
125
- )
126
-
127
-
128
- class AsyncHealthResourceWithStreamingResponse:
129
- def __init__(self, health: AsyncHealthResource) -> None:
130
- self._health = health
131
-
132
- self.check = async_to_streamed_response_wrapper(
133
- health.check,
134
- )
relaxai/types/usage.py DELETED
@@ -1,33 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from .._models import BaseModel
4
-
5
- __all__ = ["Usage", "CompletionTokensDetails", "PromptTokensDetails"]
6
-
7
-
8
- class CompletionTokensDetails(BaseModel):
9
- accepted_prediction_tokens: int
10
-
11
- audio_tokens: int
12
-
13
- reasoning_tokens: int
14
-
15
- rejected_prediction_tokens: int
16
-
17
-
18
- class PromptTokensDetails(BaseModel):
19
- audio_tokens: int
20
-
21
- cached_tokens: int
22
-
23
-
24
- class Usage(BaseModel):
25
- completion_tokens: int
26
-
27
- completion_tokens_details: CompletionTokensDetails
28
-
29
- prompt_tokens: int
30
-
31
- prompt_tokens_details: PromptTokensDetails
32
-
33
- total_tokens: int
@@ -1,50 +0,0 @@
1
- relaxai/__init__.py,sha256=jawpphZN3cZd39n6_t5JS-ypY59otlavNWnrP--HOHU,2587
2
- relaxai/_base_client.py,sha256=_FDl5IhRWrFRkktJpIjmHgagrMupFj1FSVvr3t302sE,66716
3
- relaxai/_client.py,sha256=jgqv6k3Soy6PWVJCWcDcwAhrWfUGNiKUrVnXPw5Gpog,17017
4
- relaxai/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
- relaxai/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
- relaxai/_exceptions.py,sha256=CPRCoUcv5nQ7_hkZu9WvAFxQM0Mf6_ZCGU8JPY81zpY,3222
7
- relaxai/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- relaxai/_models.py,sha256=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
9
- relaxai/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
- relaxai/_resource.py,sha256=v7qxjafEaUaEfecj54WhuhW2hupVzM8Os0EIHVRmbkc,1106
11
- relaxai/_response.py,sha256=URFVS4ivxSoLsvosTN0Rc3f5vbBBb0DIB4Eh2XPGa_Q,28794
12
- relaxai/_streaming.py,sha256=Nr4O_q1hh35alNVqo46KKf9ZTbRp-IoXjGFCCNJC1fA,10104
13
- relaxai/_types.py,sha256=hzXV2igITH7hq2g4zoT8DOcWoTygjpuzRT2OUh1-V1w,6198
14
- relaxai/_version.py,sha256=lBO430l8VQJh2gQ8xBMny3iZoevD2Qjh21tlBGgBU44,159
15
- relaxai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
- relaxai/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
- relaxai/_utils/_logs.py,sha256=JN6s4kBek7yKmmZ_YwCsGFuRdVLEaxfgdkCgnJWcFN0,777
18
- relaxai/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
19
- relaxai/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
- relaxai/_utils/_resources_proxy.py,sha256=9_EObM8JvNkCjrPt8cs1fv4Zitbzv6UQjJJA-GKm4Tw,594
21
- relaxai/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
22
- relaxai/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
23
- relaxai/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
24
- relaxai/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
25
- relaxai/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
26
- relaxai/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
- relaxai/resources/__init__.py,sha256=iXDN-kkHrROvAkOUiXDtVoAiRL1HN1EI81guF9i50Qs,1928
28
- relaxai/resources/chat.py,sha256=yHDf-wGgcxg09tOvknvTWBbZJ8NdPLH675Gtw0pjB6M,12032
29
- relaxai/resources/embeddings.py,sha256=aOaXQ_FBaDMOjYRX-DTz5_swDHe-UC75Gu-xupKmMtU,6929
30
- relaxai/resources/health.py,sha256=fitWsb_aSpWLfhUjTeKy4qGbEKZGW74DWeIljPibb8I,4749
31
- relaxai/resources/models.py,sha256=7osSj1mo_uZD1AVZzqMCUKA_4UUu6DsVwdeZ3BE1gwo,7775
32
- relaxai/types/__init__.py,sha256=DEebMov45PQuP_MWBojMGygclVIHTxJsA0wquu5GklA,1204
33
- relaxai/types/chat_completion_message.py,sha256=62FWhEZcz6B9YRb22h6Wze5VJL3uSs1PuAowgpQUDTQ,1128
34
- relaxai/types/chat_completion_message_param.py,sha256=u5jQ52sy3nboKBGeO9qhtwRCopsQlIm1iP02l5wVGJ8,1086
35
- relaxai/types/chat_create_completion_params.py,sha256=HErJzeT8_EuM6hW5edfWdMbsZG9cB0TXWxY_4Rr9870,1833
36
- relaxai/types/chat_create_completion_response.py,sha256=qkwHNJCzeL_B-78bnYmIFAahBDLplvQNaT437nsQPHo,1550
37
- relaxai/types/content_filter_results.py,sha256=vOaHu4jdGKVX4vqqCZohTYDsKDXlvfh57Ozb_95-c2U,999
38
- relaxai/types/embedding_create_params.py,sha256=GohmpGhT2WkXr0EY-oMlXHFrv4avYeyLGWmwuHclwuk,381
39
- relaxai/types/embedding_create_response.py,sha256=R5bMlsA78dXNWmcTM79qpHj7oMdxI8c4FFVTJup4lpk,535
40
- relaxai/types/function_call.py,sha256=n_agCO6Vrh5YZH1SZ6GWOV4mk2IFPeHJA_WkZrPGPMw,277
41
- relaxai/types/function_call_param.py,sha256=X-bQ7vMH7BKrAiweHRGY5fGzddPLkppUOa1R1T5etg0,281
42
- relaxai/types/function_definition_param.py,sha256=HqGQTiwZ4vXGYgYC2iscc_THORFPSZ1qXxnXpAc-A_8,367
43
- relaxai/types/health_check_response.py,sha256=6Zn5YYHCQf2RgMjDlf39mtiTPqfaBfC9Vv599U_rKCI,200
44
- relaxai/types/model.py,sha256=Du9lb9dn846N1fPrKtDsPSLczkqnzxVAJPb8GMqyVJ8,764
45
- relaxai/types/model_list_response.py,sha256=zGGRmJLFa5AQ5R2P75E6Qh5wUjtolqcMkXXJTzzy9nA,380
46
- relaxai/types/usage.py,sha256=5KaiAggU1xFXDajFkIbHII-RarAiAsJE-4ECBs-AJZg,647
47
- relaxai-0.0.1.dist-info/METADATA,sha256=w10Vj12ufcWqdtpfEOvYvpJiIuDaSprnmj2XJU3_PoA,15002
48
- relaxai-0.0.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
49
- relaxai-0.0.1.dist-info/licenses/LICENSE,sha256=B0u5zBqmaNCfIZooH665f2J7yFqMmSjQxZtnJhCuID8,11337
50
- relaxai-0.0.1.dist-info/RECORD,,