relaxai 0.0.1__py3-none-any.whl → 0.17.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.
- relaxai/_base_client.py +12 -2
- relaxai/_client.py +77 -40
- relaxai/_files.py +4 -4
- relaxai/_models.py +31 -7
- relaxai/_version.py +1 -1
- relaxai/resources/__init__.py +0 -14
- relaxai/resources/chat.py +38 -13
- relaxai/resources/embeddings.py +18 -18
- relaxai/resources/models.py +57 -57
- relaxai/types/__init__.py +11 -6
- relaxai/types/chat_completion_message.py +29 -3
- relaxai/types/chat_completion_message_param.py +29 -4
- relaxai/types/{chat_create_completion_response.py → chat_completion_response.py} +4 -4
- relaxai/types/chat_create_completion_params.py +40 -8
- relaxai/types/{embedding_create_params.py → embedding_create_embedding_params.py} +2 -2
- relaxai/types/{embedding_create_response.py → embedding_response.py} +4 -4
- relaxai/types/{health_check_response.py → health_response.py} +2 -2
- relaxai/types/{model_list_response.py → model_list.py} +2 -2
- relaxai/types/shared/__init__.py +5 -0
- relaxai/types/shared/openai_completion_tokens_details.py +15 -0
- relaxai/types/shared/openai_prompt_tokens_details.py +11 -0
- relaxai/types/shared/openai_usage.py +19 -0
- relaxai/types/stream_options_param.py +11 -0
- {relaxai-0.0.1.dist-info → relaxai-0.17.0.dist-info}/METADATA +48 -39
- relaxai-0.17.0.dist-info/RECORD +53 -0
- relaxai/resources/health.py +0 -134
- relaxai/types/usage.py +0 -33
- relaxai-0.0.1.dist-info/RECORD +0 -50
- {relaxai-0.0.1.dist-info → relaxai-0.17.0.dist-info}/WHEEL +0 -0
- {relaxai-0.0.1.dist-info → relaxai-0.17.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
|
3
|
+
Version: 0.17.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@
|
|
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.
|
|
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
|
-
|
|
38
|
+
<!-- prettier-ignore -->
|
|
39
|
+
[)](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
|
-
|
|
70
|
+
chat_completion_response = client.chat.create_completion(
|
|
69
71
|
messages=[
|
|
70
72
|
{
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
+
"role": "user",
|
|
74
|
+
"content": "Hello, how are you?",
|
|
73
75
|
}
|
|
74
76
|
],
|
|
75
|
-
model="
|
|
77
|
+
model="Llama-4-Maverick-17B-128E",
|
|
78
|
+
max_tokens=100,
|
|
76
79
|
)
|
|
77
|
-
print(
|
|
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
|
-
|
|
103
|
+
chat_completion_response = await client.chat.create_completion(
|
|
101
104
|
messages=[
|
|
102
105
|
{
|
|
103
|
-
"
|
|
104
|
-
"
|
|
106
|
+
"role": "user",
|
|
107
|
+
"content": "Hello, how are you?",
|
|
105
108
|
}
|
|
106
109
|
],
|
|
107
|
-
model="
|
|
110
|
+
model="Llama-4-Maverick-17B-128E",
|
|
111
|
+
max_tokens=100,
|
|
108
112
|
)
|
|
109
|
-
print(
|
|
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=
|
|
142
|
+
api_key="My API Key",
|
|
140
143
|
http_client=DefaultAioHttpClient(),
|
|
141
144
|
) as client:
|
|
142
|
-
|
|
145
|
+
chat_completion_response = await client.chat.create_completion(
|
|
143
146
|
messages=[
|
|
144
147
|
{
|
|
145
|
-
"
|
|
146
|
-
"
|
|
148
|
+
"role": "user",
|
|
149
|
+
"content": "Hello, how are you?",
|
|
147
150
|
}
|
|
148
151
|
],
|
|
149
|
-
model="
|
|
152
|
+
model="Llama-4-Maverick-17B-128E",
|
|
153
|
+
max_tokens=100,
|
|
150
154
|
)
|
|
151
|
-
print(
|
|
155
|
+
print(chat_completion_response.choices)
|
|
152
156
|
|
|
153
157
|
|
|
154
158
|
asyncio.run(main())
|
|
@@ -172,10 +176,10 @@ from relaxai import Relaxai
|
|
|
172
176
|
|
|
173
177
|
client = Relaxai()
|
|
174
178
|
|
|
175
|
-
|
|
179
|
+
chat_completion_response = client.chat.create_completion(
|
|
176
180
|
messages=[
|
|
177
181
|
{
|
|
178
|
-
"
|
|
182
|
+
"content": "content",
|
|
179
183
|
"role": "role",
|
|
180
184
|
}
|
|
181
185
|
],
|
|
@@ -185,7 +189,7 @@ response = client.chat.create_completion(
|
|
|
185
189
|
"type": "type",
|
|
186
190
|
},
|
|
187
191
|
)
|
|
188
|
-
print(
|
|
192
|
+
print(chat_completion_response.prediction)
|
|
189
193
|
```
|
|
190
194
|
|
|
191
195
|
## Handling errors
|
|
@@ -207,11 +211,12 @@ try:
|
|
|
207
211
|
client.chat.create_completion(
|
|
208
212
|
messages=[
|
|
209
213
|
{
|
|
210
|
-
"
|
|
211
|
-
"
|
|
214
|
+
"role": "user",
|
|
215
|
+
"content": "Hello, how are you?",
|
|
212
216
|
}
|
|
213
217
|
],
|
|
214
|
-
model="
|
|
218
|
+
model="Llama-4-Maverick-17B-128E",
|
|
219
|
+
max_tokens=100,
|
|
215
220
|
)
|
|
216
221
|
except relaxai.APIConnectionError as e:
|
|
217
222
|
print("The server could not be reached")
|
|
@@ -258,11 +263,12 @@ client = Relaxai(
|
|
|
258
263
|
client.with_options(max_retries=5).chat.create_completion(
|
|
259
264
|
messages=[
|
|
260
265
|
{
|
|
261
|
-
"
|
|
262
|
-
"
|
|
266
|
+
"role": "user",
|
|
267
|
+
"content": "Hello, how are you?",
|
|
263
268
|
}
|
|
264
269
|
],
|
|
265
|
-
model="
|
|
270
|
+
model="Llama-4-Maverick-17B-128E",
|
|
271
|
+
max_tokens=100,
|
|
266
272
|
)
|
|
267
273
|
```
|
|
268
274
|
|
|
@@ -289,11 +295,12 @@ client = Relaxai(
|
|
|
289
295
|
client.with_options(timeout=5.0).chat.create_completion(
|
|
290
296
|
messages=[
|
|
291
297
|
{
|
|
292
|
-
"
|
|
293
|
-
"
|
|
298
|
+
"role": "user",
|
|
299
|
+
"content": "Hello, how are you?",
|
|
294
300
|
}
|
|
295
301
|
],
|
|
296
|
-
model="
|
|
302
|
+
model="Llama-4-Maverick-17B-128E",
|
|
303
|
+
max_tokens=100,
|
|
297
304
|
)
|
|
298
305
|
```
|
|
299
306
|
|
|
@@ -337,10 +344,11 @@ from relaxai import Relaxai
|
|
|
337
344
|
client = Relaxai()
|
|
338
345
|
response = client.chat.with_raw_response.create_completion(
|
|
339
346
|
messages=[{
|
|
340
|
-
"
|
|
341
|
-
"
|
|
347
|
+
"role": "user",
|
|
348
|
+
"content": "Hello, how are you?",
|
|
342
349
|
}],
|
|
343
|
-
model="
|
|
350
|
+
model="Llama-4-Maverick-17B-128E",
|
|
351
|
+
max_tokens=100,
|
|
344
352
|
)
|
|
345
353
|
print(response.headers.get('X-My-Header'))
|
|
346
354
|
|
|
@@ -362,11 +370,12 @@ To stream the response body, use `.with_streaming_response` instead, which requi
|
|
|
362
370
|
with client.chat.with_streaming_response.create_completion(
|
|
363
371
|
messages=[
|
|
364
372
|
{
|
|
365
|
-
"
|
|
366
|
-
"
|
|
373
|
+
"role": "user",
|
|
374
|
+
"content": "Hello, how are you?",
|
|
367
375
|
}
|
|
368
376
|
],
|
|
369
|
-
model="
|
|
377
|
+
model="Llama-4-Maverick-17B-128E",
|
|
378
|
+
max_tokens=100,
|
|
370
379
|
) as response:
|
|
371
380
|
print(response.headers.get("X-My-Header"))
|
|
372
381
|
|
|
@@ -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=5ikGSyEPdlTvVZ6jGVja-HEVSucoe3D0WBX85F-c_jM,160
|
|
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=_X_3t8JuCCwXYZrnu_63tCgPhAZB8rYL5TnBaKjlhMU,13209
|
|
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=PVrcRwctJ1Gr4m1W1BwyczCMpHn-3Zw9YUbLwgpG12M,2664
|
|
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=HqGQTiwZ4vXGYgYC2iscc_THORFPSZ1qXxnXpAc-A_8,367
|
|
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.17.0.dist-info/METADATA,sha256=-5j0U0gLKC-TtvJn9FIP511b7SAURQeKo7ojaIrc1G0,15520
|
|
51
|
+
relaxai-0.17.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
52
|
+
relaxai-0.17.0.dist-info/licenses/LICENSE,sha256=B0u5zBqmaNCfIZooH665f2J7yFqMmSjQxZtnJhCuID8,11337
|
|
53
|
+
relaxai-0.17.0.dist-info/RECORD,,
|
relaxai/resources/health.py
DELETED
|
@@ -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
|
relaxai-0.0.1.dist-info/RECORD
DELETED
|
@@ -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,,
|
|
File without changes
|
|
File without changes
|