arbi 0.1.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 arbi might be problematic. Click here for more details.
- arbi/__init__.py +90 -0
- arbi/_base_client.py +1995 -0
- arbi/_client.py +394 -0
- arbi/_compat.py +219 -0
- arbi/_constants.py +14 -0
- arbi/_exceptions.py +108 -0
- arbi/_files.py +123 -0
- arbi/_models.py +829 -0
- arbi/_qs.py +150 -0
- arbi/_resource.py +43 -0
- arbi/_response.py +830 -0
- arbi/_streaming.py +333 -0
- arbi/_types.py +219 -0
- arbi/_utils/__init__.py +57 -0
- arbi/_utils/_logs.py +25 -0
- arbi/_utils/_proxy.py +65 -0
- arbi/_utils/_reflection.py +42 -0
- arbi/_utils/_resources_proxy.py +24 -0
- arbi/_utils/_streams.py +12 -0
- arbi/_utils/_sync.py +86 -0
- arbi/_utils/_transform.py +447 -0
- arbi/_utils/_typing.py +151 -0
- arbi/_utils/_utils.py +422 -0
- arbi/_version.py +4 -0
- arbi/lib/.keep +4 -0
- arbi/py.typed +0 -0
- arbi/resources/__init__.py +19 -0
- arbi/resources/api/__init__.py +145 -0
- arbi/resources/api/api.py +422 -0
- arbi/resources/api/assistant.py +300 -0
- arbi/resources/api/configs.py +499 -0
- arbi/resources/api/conversation/__init__.py +33 -0
- arbi/resources/api/conversation/conversation.py +555 -0
- arbi/resources/api/conversation/user.py +270 -0
- arbi/resources/api/document/__init__.py +33 -0
- arbi/resources/api/document/annotation.py +384 -0
- arbi/resources/api/document/document.py +873 -0
- arbi/resources/api/health.py +304 -0
- arbi/resources/api/sso.py +333 -0
- arbi/resources/api/tag.py +614 -0
- arbi/resources/api/user/__init__.py +33 -0
- arbi/resources/api/user/settings.py +251 -0
- arbi/resources/api/user/user.py +532 -0
- arbi/resources/api/workspace.py +1061 -0
- arbi/types/__init__.py +8 -0
- arbi/types/api/__init__.py +84 -0
- arbi/types/api/assistant_query_params.py +59 -0
- arbi/types/api/assistant_retrieve_params.py +59 -0
- arbi/types/api/chunker_config_param.py +9 -0
- arbi/types/api/config_create_params.py +45 -0
- arbi/types/api/config_create_response.py +15 -0
- arbi/types/api/config_delete_response.py +11 -0
- arbi/types/api/config_get_versions_response.py +19 -0
- arbi/types/api/config_retrieve_response.py +46 -0
- arbi/types/api/conversation/__init__.py +8 -0
- arbi/types/api/conversation/user_add_params.py +11 -0
- arbi/types/api/conversation/user_add_response.py +11 -0
- arbi/types/api/conversation/user_remove_params.py +11 -0
- arbi/types/api/conversation/user_remove_response.py +11 -0
- arbi/types/api/conversation_delete_message_response.py +11 -0
- arbi/types/api/conversation_delete_response.py +11 -0
- arbi/types/api/conversation_retrieve_threads_response.py +91 -0
- arbi/types/api/conversation_share_response.py +11 -0
- arbi/types/api/conversation_update_title_params.py +12 -0
- arbi/types/api/conversation_update_title_response.py +13 -0
- arbi/types/api/doc_response.py +48 -0
- arbi/types/api/document/__init__.py +8 -0
- arbi/types/api/document/annotation_create_params.py +16 -0
- arbi/types/api/document/annotation_delete_response.py +11 -0
- arbi/types/api/document/annotation_update_params.py +16 -0
- arbi/types/api/document/doc_tag_response.py +26 -0
- arbi/types/api/document_date_extractor_llm_config.py +29 -0
- arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
- arbi/types/api/document_delete_response.py +11 -0
- arbi/types/api/document_get_parsed_response.py +26 -0
- arbi/types/api/document_get_tags_response.py +10 -0
- arbi/types/api/document_update_params.py +19 -0
- arbi/types/api/document_update_response.py +22 -0
- arbi/types/api/document_upload_params.py +23 -0
- arbi/types/api/document_view_params.py +13 -0
- arbi/types/api/embedder_config.py +18 -0
- arbi/types/api/embedder_config_param.py +17 -0
- arbi/types/api/health_check_app_response.py +9 -0
- arbi/types/api/health_check_models_response.py +21 -0
- arbi/types/api/health_check_services_response.py +23 -0
- arbi/types/api/health_get_models_response.py +19 -0
- arbi/types/api/model_citation_config.py +23 -0
- arbi/types/api/model_citation_config_param.py +23 -0
- arbi/types/api/parser_config_param.py +9 -0
- arbi/types/api/query_llm_config.py +30 -0
- arbi/types/api/query_llm_config_param.py +29 -0
- arbi/types/api/reranker_config.py +21 -0
- arbi/types/api/reranker_config_param.py +20 -0
- arbi/types/api/retriever_config.py +23 -0
- arbi/types/api/retriever_config_param.py +23 -0
- arbi/types/api/sso_invite_params.py +11 -0
- arbi/types/api/sso_invite_response.py +11 -0
- arbi/types/api/sso_login_params.py +16 -0
- arbi/types/api/sso_login_response.py +15 -0
- arbi/types/api/sso_rotate_passcode_response.py +11 -0
- arbi/types/api/tag_apply_to_docs_params.py +12 -0
- arbi/types/api/tag_apply_to_docs_response.py +13 -0
- arbi/types/api/tag_create_params.py +18 -0
- arbi/types/api/tag_create_response.py +11 -0
- arbi/types/api/tag_delete_response.py +9 -0
- arbi/types/api/tag_get_docs_response.py +10 -0
- arbi/types/api/tag_remove_from_docs_params.py +12 -0
- arbi/types/api/tag_remove_from_docs_response.py +13 -0
- arbi/types/api/tag_update_params.py +14 -0
- arbi/types/api/tag_update_response.py +17 -0
- arbi/types/api/title_llm_config.py +29 -0
- arbi/types/api/title_llm_config_param.py +28 -0
- arbi/types/api/token.py +13 -0
- arbi/types/api/user/__init__.py +6 -0
- arbi/types/api/user/setting_retrieve_response.py +36 -0
- arbi/types/api/user/setting_update_params.py +24 -0
- arbi/types/api/user_list_workspaces_response.py +10 -0
- arbi/types/api/user_login_params.py +13 -0
- arbi/types/api/user_logout_response.py +9 -0
- arbi/types/api/user_register_params.py +17 -0
- arbi/types/api/user_response.py +19 -0
- arbi/types/api/workspace_create_protected_params.py +14 -0
- arbi/types/api/workspace_delete_response.py +9 -0
- arbi/types/api/workspace_get_conversations_response.py +28 -0
- arbi/types/api/workspace_get_doctags_response.py +10 -0
- arbi/types/api/workspace_get_documents_response.py +10 -0
- arbi/types/api/workspace_get_stats_response.py +13 -0
- arbi/types/api/workspace_get_tags_response.py +30 -0
- arbi/types/api/workspace_get_users_response.py +17 -0
- arbi/types/api/workspace_remove_user_params.py +11 -0
- arbi/types/api/workspace_remove_user_response.py +11 -0
- arbi/types/api/workspace_response.py +24 -0
- arbi/types/api/workspace_share_params.py +11 -0
- arbi/types/api/workspace_share_response.py +21 -0
- arbi/types/api/workspace_update_params.py +14 -0
- arbi/types/chunk.py +12 -0
- arbi/types/chunk_metadata.py +31 -0
- arbi/types/chunk_metadata_param.py +32 -0
- arbi/types/chunk_param.py +15 -0
- arbi-0.1.0.dist-info/METADATA +410 -0
- arbi-0.1.0.dist-info/RECORD +143 -0
- arbi-0.1.0.dist-info/WHEEL +4 -0
- arbi-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,304 @@
|
|
|
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
|
+
from ...types.api.health_check_app_response import HealthCheckAppResponse
|
|
18
|
+
from ...types.api.health_get_models_response import HealthGetModelsResponse
|
|
19
|
+
from ...types.api.health_check_models_response import HealthCheckModelsResponse
|
|
20
|
+
from ...types.api.health_check_services_response import HealthCheckServicesResponse
|
|
21
|
+
|
|
22
|
+
__all__ = ["HealthResource", "AsyncHealthResource"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class HealthResource(SyncAPIResource):
|
|
26
|
+
@cached_property
|
|
27
|
+
def with_raw_response(self) -> HealthResourceWithRawResponse:
|
|
28
|
+
"""
|
|
29
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
30
|
+
the raw response object instead of the parsed content.
|
|
31
|
+
|
|
32
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
33
|
+
"""
|
|
34
|
+
return HealthResourceWithRawResponse(self)
|
|
35
|
+
|
|
36
|
+
@cached_property
|
|
37
|
+
def with_streaming_response(self) -> HealthResourceWithStreamingResponse:
|
|
38
|
+
"""
|
|
39
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
40
|
+
|
|
41
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
42
|
+
"""
|
|
43
|
+
return HealthResourceWithStreamingResponse(self)
|
|
44
|
+
|
|
45
|
+
def check_app(
|
|
46
|
+
self,
|
|
47
|
+
*,
|
|
48
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
49
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
50
|
+
extra_headers: Headers | None = None,
|
|
51
|
+
extra_query: Query | None = None,
|
|
52
|
+
extra_body: Body | None = None,
|
|
53
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
54
|
+
) -> HealthCheckAppResponse:
|
|
55
|
+
"""Lightweight health check endpoint for the arbi-app itself."""
|
|
56
|
+
return self._get(
|
|
57
|
+
"/api/health/app",
|
|
58
|
+
options=make_request_options(
|
|
59
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
60
|
+
),
|
|
61
|
+
cast_to=HealthCheckAppResponse,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
def check_models(
|
|
65
|
+
self,
|
|
66
|
+
*,
|
|
67
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
68
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
69
|
+
extra_headers: Headers | None = None,
|
|
70
|
+
extra_query: Query | None = None,
|
|
71
|
+
extra_body: Body | None = None,
|
|
72
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
73
|
+
) -> HealthCheckModelsResponse:
|
|
74
|
+
"""
|
|
75
|
+
Endpoint to check the health of various models hosted on the LiteLLM platform.
|
|
76
|
+
This endpoint fetches a list of available models and checks if each one is
|
|
77
|
+
operational.
|
|
78
|
+
"""
|
|
79
|
+
return self._get(
|
|
80
|
+
"/api/health/remote-models",
|
|
81
|
+
options=make_request_options(
|
|
82
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
83
|
+
),
|
|
84
|
+
cast_to=HealthCheckModelsResponse,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
def check_services(
|
|
88
|
+
self,
|
|
89
|
+
*,
|
|
90
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
91
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
92
|
+
extra_headers: Headers | None = None,
|
|
93
|
+
extra_query: Query | None = None,
|
|
94
|
+
extra_body: Body | None = None,
|
|
95
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
96
|
+
) -> HealthCheckServicesResponse:
|
|
97
|
+
"""
|
|
98
|
+
Health check endpoint that verifies the status of the application and external
|
|
99
|
+
services. Always returns a structured object with the health status of all
|
|
100
|
+
services.
|
|
101
|
+
"""
|
|
102
|
+
return self._get(
|
|
103
|
+
"/api/health/services",
|
|
104
|
+
options=make_request_options(
|
|
105
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
106
|
+
),
|
|
107
|
+
cast_to=HealthCheckServicesResponse,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
def get_models(
|
|
111
|
+
self,
|
|
112
|
+
*,
|
|
113
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
114
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
115
|
+
extra_headers: Headers | None = None,
|
|
116
|
+
extra_query: Query | None = None,
|
|
117
|
+
extra_body: Body | None = None,
|
|
118
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
119
|
+
) -> HealthGetModelsResponse:
|
|
120
|
+
"""Returns available models with model_name and api_type fields"""
|
|
121
|
+
return self._get(
|
|
122
|
+
"/api/health/models",
|
|
123
|
+
options=make_request_options(
|
|
124
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
125
|
+
),
|
|
126
|
+
cast_to=HealthGetModelsResponse,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class AsyncHealthResource(AsyncAPIResource):
|
|
131
|
+
@cached_property
|
|
132
|
+
def with_raw_response(self) -> AsyncHealthResourceWithRawResponse:
|
|
133
|
+
"""
|
|
134
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
135
|
+
the raw response object instead of the parsed content.
|
|
136
|
+
|
|
137
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
138
|
+
"""
|
|
139
|
+
return AsyncHealthResourceWithRawResponse(self)
|
|
140
|
+
|
|
141
|
+
@cached_property
|
|
142
|
+
def with_streaming_response(self) -> AsyncHealthResourceWithStreamingResponse:
|
|
143
|
+
"""
|
|
144
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
145
|
+
|
|
146
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
147
|
+
"""
|
|
148
|
+
return AsyncHealthResourceWithStreamingResponse(self)
|
|
149
|
+
|
|
150
|
+
async def check_app(
|
|
151
|
+
self,
|
|
152
|
+
*,
|
|
153
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
154
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
155
|
+
extra_headers: Headers | None = None,
|
|
156
|
+
extra_query: Query | None = None,
|
|
157
|
+
extra_body: Body | None = None,
|
|
158
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
159
|
+
) -> HealthCheckAppResponse:
|
|
160
|
+
"""Lightweight health check endpoint for the arbi-app itself."""
|
|
161
|
+
return await self._get(
|
|
162
|
+
"/api/health/app",
|
|
163
|
+
options=make_request_options(
|
|
164
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
165
|
+
),
|
|
166
|
+
cast_to=HealthCheckAppResponse,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
async def check_models(
|
|
170
|
+
self,
|
|
171
|
+
*,
|
|
172
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
173
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
174
|
+
extra_headers: Headers | None = None,
|
|
175
|
+
extra_query: Query | None = None,
|
|
176
|
+
extra_body: Body | None = None,
|
|
177
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
178
|
+
) -> HealthCheckModelsResponse:
|
|
179
|
+
"""
|
|
180
|
+
Endpoint to check the health of various models hosted on the LiteLLM platform.
|
|
181
|
+
This endpoint fetches a list of available models and checks if each one is
|
|
182
|
+
operational.
|
|
183
|
+
"""
|
|
184
|
+
return await self._get(
|
|
185
|
+
"/api/health/remote-models",
|
|
186
|
+
options=make_request_options(
|
|
187
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
188
|
+
),
|
|
189
|
+
cast_to=HealthCheckModelsResponse,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
async def check_services(
|
|
193
|
+
self,
|
|
194
|
+
*,
|
|
195
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
196
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
197
|
+
extra_headers: Headers | None = None,
|
|
198
|
+
extra_query: Query | None = None,
|
|
199
|
+
extra_body: Body | None = None,
|
|
200
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
201
|
+
) -> HealthCheckServicesResponse:
|
|
202
|
+
"""
|
|
203
|
+
Health check endpoint that verifies the status of the application and external
|
|
204
|
+
services. Always returns a structured object with the health status of all
|
|
205
|
+
services.
|
|
206
|
+
"""
|
|
207
|
+
return await self._get(
|
|
208
|
+
"/api/health/services",
|
|
209
|
+
options=make_request_options(
|
|
210
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
211
|
+
),
|
|
212
|
+
cast_to=HealthCheckServicesResponse,
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
async def get_models(
|
|
216
|
+
self,
|
|
217
|
+
*,
|
|
218
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
219
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
220
|
+
extra_headers: Headers | None = None,
|
|
221
|
+
extra_query: Query | None = None,
|
|
222
|
+
extra_body: Body | None = None,
|
|
223
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
224
|
+
) -> HealthGetModelsResponse:
|
|
225
|
+
"""Returns available models with model_name and api_type fields"""
|
|
226
|
+
return await self._get(
|
|
227
|
+
"/api/health/models",
|
|
228
|
+
options=make_request_options(
|
|
229
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
230
|
+
),
|
|
231
|
+
cast_to=HealthGetModelsResponse,
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
class HealthResourceWithRawResponse:
|
|
236
|
+
def __init__(self, health: HealthResource) -> None:
|
|
237
|
+
self._health = health
|
|
238
|
+
|
|
239
|
+
self.check_app = to_raw_response_wrapper(
|
|
240
|
+
health.check_app,
|
|
241
|
+
)
|
|
242
|
+
self.check_models = to_raw_response_wrapper(
|
|
243
|
+
health.check_models,
|
|
244
|
+
)
|
|
245
|
+
self.check_services = to_raw_response_wrapper(
|
|
246
|
+
health.check_services,
|
|
247
|
+
)
|
|
248
|
+
self.get_models = to_raw_response_wrapper(
|
|
249
|
+
health.get_models,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class AsyncHealthResourceWithRawResponse:
|
|
254
|
+
def __init__(self, health: AsyncHealthResource) -> None:
|
|
255
|
+
self._health = health
|
|
256
|
+
|
|
257
|
+
self.check_app = async_to_raw_response_wrapper(
|
|
258
|
+
health.check_app,
|
|
259
|
+
)
|
|
260
|
+
self.check_models = async_to_raw_response_wrapper(
|
|
261
|
+
health.check_models,
|
|
262
|
+
)
|
|
263
|
+
self.check_services = async_to_raw_response_wrapper(
|
|
264
|
+
health.check_services,
|
|
265
|
+
)
|
|
266
|
+
self.get_models = async_to_raw_response_wrapper(
|
|
267
|
+
health.get_models,
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
class HealthResourceWithStreamingResponse:
|
|
272
|
+
def __init__(self, health: HealthResource) -> None:
|
|
273
|
+
self._health = health
|
|
274
|
+
|
|
275
|
+
self.check_app = to_streamed_response_wrapper(
|
|
276
|
+
health.check_app,
|
|
277
|
+
)
|
|
278
|
+
self.check_models = to_streamed_response_wrapper(
|
|
279
|
+
health.check_models,
|
|
280
|
+
)
|
|
281
|
+
self.check_services = to_streamed_response_wrapper(
|
|
282
|
+
health.check_services,
|
|
283
|
+
)
|
|
284
|
+
self.get_models = to_streamed_response_wrapper(
|
|
285
|
+
health.get_models,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
class AsyncHealthResourceWithStreamingResponse:
|
|
290
|
+
def __init__(self, health: AsyncHealthResource) -> None:
|
|
291
|
+
self._health = health
|
|
292
|
+
|
|
293
|
+
self.check_app = async_to_streamed_response_wrapper(
|
|
294
|
+
health.check_app,
|
|
295
|
+
)
|
|
296
|
+
self.check_models = async_to_streamed_response_wrapper(
|
|
297
|
+
health.check_models,
|
|
298
|
+
)
|
|
299
|
+
self.check_services = async_to_streamed_response_wrapper(
|
|
300
|
+
health.check_services,
|
|
301
|
+
)
|
|
302
|
+
self.get_models = async_to_streamed_response_wrapper(
|
|
303
|
+
health.get_models,
|
|
304
|
+
)
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._compat import cached_property
|
|
12
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ..._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ...types.api import sso_login_params, sso_invite_params
|
|
20
|
+
from ..._base_client import make_request_options
|
|
21
|
+
from ...types.api.sso_login_response import SSOLoginResponse
|
|
22
|
+
from ...types.api.sso_invite_response import SSOInviteResponse
|
|
23
|
+
from ...types.api.sso_rotate_passcode_response import SSORotatePasscodeResponse
|
|
24
|
+
|
|
25
|
+
__all__ = ["SSOResource", "AsyncSSOResource"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SSOResource(SyncAPIResource):
|
|
29
|
+
@cached_property
|
|
30
|
+
def with_raw_response(self) -> SSOResourceWithRawResponse:
|
|
31
|
+
"""
|
|
32
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
33
|
+
the raw response object instead of the parsed content.
|
|
34
|
+
|
|
35
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
36
|
+
"""
|
|
37
|
+
return SSOResourceWithRawResponse(self)
|
|
38
|
+
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_streaming_response(self) -> SSOResourceWithStreamingResponse:
|
|
41
|
+
"""
|
|
42
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
43
|
+
|
|
44
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
45
|
+
"""
|
|
46
|
+
return SSOResourceWithStreamingResponse(self)
|
|
47
|
+
|
|
48
|
+
def invite(
|
|
49
|
+
self,
|
|
50
|
+
*,
|
|
51
|
+
email: str,
|
|
52
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
53
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
54
|
+
extra_headers: Headers | None = None,
|
|
55
|
+
extra_query: Query | None = None,
|
|
56
|
+
extra_body: Body | None = None,
|
|
57
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
58
|
+
) -> SSOInviteResponse:
|
|
59
|
+
"""Invite a user to the deployment via email.
|
|
60
|
+
|
|
61
|
+
Creates a pre-registered user account
|
|
62
|
+
with blocked status and no sub field. The central server will send the user an
|
|
63
|
+
invitation email with a passcode.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
extra_headers: Send extra headers
|
|
67
|
+
|
|
68
|
+
extra_query: Add additional query parameters to the request
|
|
69
|
+
|
|
70
|
+
extra_body: Add additional JSON properties to the request
|
|
71
|
+
|
|
72
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
73
|
+
"""
|
|
74
|
+
return self._post(
|
|
75
|
+
"/api/sso/invite",
|
|
76
|
+
body=maybe_transform({"email": email}, sso_invite_params.SSOInviteParams),
|
|
77
|
+
options=make_request_options(
|
|
78
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
79
|
+
),
|
|
80
|
+
cast_to=SSOInviteResponse,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
def login(
|
|
84
|
+
self,
|
|
85
|
+
*,
|
|
86
|
+
token: str,
|
|
87
|
+
email: str,
|
|
88
|
+
passcode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
89
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
90
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
91
|
+
extra_headers: Headers | None = None,
|
|
92
|
+
extra_query: Query | None = None,
|
|
93
|
+
extra_body: Body | None = None,
|
|
94
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
95
|
+
) -> SSOLoginResponse:
|
|
96
|
+
"""Handle SSO login with JWT token authentication.
|
|
97
|
+
|
|
98
|
+
Creates a new user account if
|
|
99
|
+
needed or validates existing user credentials.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
extra_headers: Send extra headers
|
|
103
|
+
|
|
104
|
+
extra_query: Add additional query parameters to the request
|
|
105
|
+
|
|
106
|
+
extra_body: Add additional JSON properties to the request
|
|
107
|
+
|
|
108
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
109
|
+
"""
|
|
110
|
+
return self._post(
|
|
111
|
+
"/api/sso/login",
|
|
112
|
+
body=maybe_transform(
|
|
113
|
+
{
|
|
114
|
+
"token": token,
|
|
115
|
+
"email": email,
|
|
116
|
+
"passcode": passcode,
|
|
117
|
+
},
|
|
118
|
+
sso_login_params.SSOLoginParams,
|
|
119
|
+
),
|
|
120
|
+
options=make_request_options(
|
|
121
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
122
|
+
),
|
|
123
|
+
cast_to=SSOLoginResponse,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
def rotate_passcode(
|
|
127
|
+
self,
|
|
128
|
+
*,
|
|
129
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
130
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
131
|
+
extra_headers: Headers | None = None,
|
|
132
|
+
extra_query: Query | None = None,
|
|
133
|
+
extra_body: Body | None = None,
|
|
134
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
135
|
+
) -> SSORotatePasscodeResponse:
|
|
136
|
+
"""
|
|
137
|
+
Generate a new passcode for the current user.
|
|
138
|
+
|
|
139
|
+
This endpoint gets a new passcode from the central server and re-wraps the
|
|
140
|
+
user's private key with the new passcode. The user must be authenticated with a
|
|
141
|
+
valid token to use this endpoint.
|
|
142
|
+
"""
|
|
143
|
+
return self._post(
|
|
144
|
+
"/api/sso/rotate_passcode",
|
|
145
|
+
options=make_request_options(
|
|
146
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
147
|
+
),
|
|
148
|
+
cast_to=SSORotatePasscodeResponse,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class AsyncSSOResource(AsyncAPIResource):
|
|
153
|
+
@cached_property
|
|
154
|
+
def with_raw_response(self) -> AsyncSSOResourceWithRawResponse:
|
|
155
|
+
"""
|
|
156
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
157
|
+
the raw response object instead of the parsed content.
|
|
158
|
+
|
|
159
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
|
|
160
|
+
"""
|
|
161
|
+
return AsyncSSOResourceWithRawResponse(self)
|
|
162
|
+
|
|
163
|
+
@cached_property
|
|
164
|
+
def with_streaming_response(self) -> AsyncSSOResourceWithStreamingResponse:
|
|
165
|
+
"""
|
|
166
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
167
|
+
|
|
168
|
+
For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
|
|
169
|
+
"""
|
|
170
|
+
return AsyncSSOResourceWithStreamingResponse(self)
|
|
171
|
+
|
|
172
|
+
async def invite(
|
|
173
|
+
self,
|
|
174
|
+
*,
|
|
175
|
+
email: str,
|
|
176
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
177
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
178
|
+
extra_headers: Headers | None = None,
|
|
179
|
+
extra_query: Query | None = None,
|
|
180
|
+
extra_body: Body | None = None,
|
|
181
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
182
|
+
) -> SSOInviteResponse:
|
|
183
|
+
"""Invite a user to the deployment via email.
|
|
184
|
+
|
|
185
|
+
Creates a pre-registered user account
|
|
186
|
+
with blocked status and no sub field. The central server will send the user an
|
|
187
|
+
invitation email with a passcode.
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
extra_headers: Send extra headers
|
|
191
|
+
|
|
192
|
+
extra_query: Add additional query parameters to the request
|
|
193
|
+
|
|
194
|
+
extra_body: Add additional JSON properties to the request
|
|
195
|
+
|
|
196
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
197
|
+
"""
|
|
198
|
+
return await self._post(
|
|
199
|
+
"/api/sso/invite",
|
|
200
|
+
body=await async_maybe_transform({"email": email}, sso_invite_params.SSOInviteParams),
|
|
201
|
+
options=make_request_options(
|
|
202
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
203
|
+
),
|
|
204
|
+
cast_to=SSOInviteResponse,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
async def login(
|
|
208
|
+
self,
|
|
209
|
+
*,
|
|
210
|
+
token: str,
|
|
211
|
+
email: str,
|
|
212
|
+
passcode: Optional[str] | NotGiven = NOT_GIVEN,
|
|
213
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
214
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
215
|
+
extra_headers: Headers | None = None,
|
|
216
|
+
extra_query: Query | None = None,
|
|
217
|
+
extra_body: Body | None = None,
|
|
218
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
219
|
+
) -> SSOLoginResponse:
|
|
220
|
+
"""Handle SSO login with JWT token authentication.
|
|
221
|
+
|
|
222
|
+
Creates a new user account if
|
|
223
|
+
needed or validates existing user credentials.
|
|
224
|
+
|
|
225
|
+
Args:
|
|
226
|
+
extra_headers: Send extra headers
|
|
227
|
+
|
|
228
|
+
extra_query: Add additional query parameters to the request
|
|
229
|
+
|
|
230
|
+
extra_body: Add additional JSON properties to the request
|
|
231
|
+
|
|
232
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
233
|
+
"""
|
|
234
|
+
return await self._post(
|
|
235
|
+
"/api/sso/login",
|
|
236
|
+
body=await async_maybe_transform(
|
|
237
|
+
{
|
|
238
|
+
"token": token,
|
|
239
|
+
"email": email,
|
|
240
|
+
"passcode": passcode,
|
|
241
|
+
},
|
|
242
|
+
sso_login_params.SSOLoginParams,
|
|
243
|
+
),
|
|
244
|
+
options=make_request_options(
|
|
245
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
246
|
+
),
|
|
247
|
+
cast_to=SSOLoginResponse,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
async def rotate_passcode(
|
|
251
|
+
self,
|
|
252
|
+
*,
|
|
253
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
254
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
255
|
+
extra_headers: Headers | None = None,
|
|
256
|
+
extra_query: Query | None = None,
|
|
257
|
+
extra_body: Body | None = None,
|
|
258
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
259
|
+
) -> SSORotatePasscodeResponse:
|
|
260
|
+
"""
|
|
261
|
+
Generate a new passcode for the current user.
|
|
262
|
+
|
|
263
|
+
This endpoint gets a new passcode from the central server and re-wraps the
|
|
264
|
+
user's private key with the new passcode. The user must be authenticated with a
|
|
265
|
+
valid token to use this endpoint.
|
|
266
|
+
"""
|
|
267
|
+
return await self._post(
|
|
268
|
+
"/api/sso/rotate_passcode",
|
|
269
|
+
options=make_request_options(
|
|
270
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
271
|
+
),
|
|
272
|
+
cast_to=SSORotatePasscodeResponse,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class SSOResourceWithRawResponse:
|
|
277
|
+
def __init__(self, sso: SSOResource) -> None:
|
|
278
|
+
self._sso = sso
|
|
279
|
+
|
|
280
|
+
self.invite = to_raw_response_wrapper(
|
|
281
|
+
sso.invite,
|
|
282
|
+
)
|
|
283
|
+
self.login = to_raw_response_wrapper(
|
|
284
|
+
sso.login,
|
|
285
|
+
)
|
|
286
|
+
self.rotate_passcode = to_raw_response_wrapper(
|
|
287
|
+
sso.rotate_passcode,
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
class AsyncSSOResourceWithRawResponse:
|
|
292
|
+
def __init__(self, sso: AsyncSSOResource) -> None:
|
|
293
|
+
self._sso = sso
|
|
294
|
+
|
|
295
|
+
self.invite = async_to_raw_response_wrapper(
|
|
296
|
+
sso.invite,
|
|
297
|
+
)
|
|
298
|
+
self.login = async_to_raw_response_wrapper(
|
|
299
|
+
sso.login,
|
|
300
|
+
)
|
|
301
|
+
self.rotate_passcode = async_to_raw_response_wrapper(
|
|
302
|
+
sso.rotate_passcode,
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
class SSOResourceWithStreamingResponse:
|
|
307
|
+
def __init__(self, sso: SSOResource) -> None:
|
|
308
|
+
self._sso = sso
|
|
309
|
+
|
|
310
|
+
self.invite = to_streamed_response_wrapper(
|
|
311
|
+
sso.invite,
|
|
312
|
+
)
|
|
313
|
+
self.login = to_streamed_response_wrapper(
|
|
314
|
+
sso.login,
|
|
315
|
+
)
|
|
316
|
+
self.rotate_passcode = to_streamed_response_wrapper(
|
|
317
|
+
sso.rotate_passcode,
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
class AsyncSSOResourceWithStreamingResponse:
|
|
322
|
+
def __init__(self, sso: AsyncSSOResource) -> None:
|
|
323
|
+
self._sso = sso
|
|
324
|
+
|
|
325
|
+
self.invite = async_to_streamed_response_wrapper(
|
|
326
|
+
sso.invite,
|
|
327
|
+
)
|
|
328
|
+
self.login = async_to_streamed_response_wrapper(
|
|
329
|
+
sso.login,
|
|
330
|
+
)
|
|
331
|
+
self.rotate_passcode = async_to_streamed_response_wrapper(
|
|
332
|
+
sso.rotate_passcode,
|
|
333
|
+
)
|