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.

Files changed (143) hide show
  1. arbi/__init__.py +90 -0
  2. arbi/_base_client.py +1995 -0
  3. arbi/_client.py +394 -0
  4. arbi/_compat.py +219 -0
  5. arbi/_constants.py +14 -0
  6. arbi/_exceptions.py +108 -0
  7. arbi/_files.py +123 -0
  8. arbi/_models.py +829 -0
  9. arbi/_qs.py +150 -0
  10. arbi/_resource.py +43 -0
  11. arbi/_response.py +830 -0
  12. arbi/_streaming.py +333 -0
  13. arbi/_types.py +219 -0
  14. arbi/_utils/__init__.py +57 -0
  15. arbi/_utils/_logs.py +25 -0
  16. arbi/_utils/_proxy.py +65 -0
  17. arbi/_utils/_reflection.py +42 -0
  18. arbi/_utils/_resources_proxy.py +24 -0
  19. arbi/_utils/_streams.py +12 -0
  20. arbi/_utils/_sync.py +86 -0
  21. arbi/_utils/_transform.py +447 -0
  22. arbi/_utils/_typing.py +151 -0
  23. arbi/_utils/_utils.py +422 -0
  24. arbi/_version.py +4 -0
  25. arbi/lib/.keep +4 -0
  26. arbi/py.typed +0 -0
  27. arbi/resources/__init__.py +19 -0
  28. arbi/resources/api/__init__.py +145 -0
  29. arbi/resources/api/api.py +422 -0
  30. arbi/resources/api/assistant.py +300 -0
  31. arbi/resources/api/configs.py +499 -0
  32. arbi/resources/api/conversation/__init__.py +33 -0
  33. arbi/resources/api/conversation/conversation.py +555 -0
  34. arbi/resources/api/conversation/user.py +270 -0
  35. arbi/resources/api/document/__init__.py +33 -0
  36. arbi/resources/api/document/annotation.py +384 -0
  37. arbi/resources/api/document/document.py +873 -0
  38. arbi/resources/api/health.py +304 -0
  39. arbi/resources/api/sso.py +333 -0
  40. arbi/resources/api/tag.py +614 -0
  41. arbi/resources/api/user/__init__.py +33 -0
  42. arbi/resources/api/user/settings.py +251 -0
  43. arbi/resources/api/user/user.py +532 -0
  44. arbi/resources/api/workspace.py +1061 -0
  45. arbi/types/__init__.py +8 -0
  46. arbi/types/api/__init__.py +84 -0
  47. arbi/types/api/assistant_query_params.py +59 -0
  48. arbi/types/api/assistant_retrieve_params.py +59 -0
  49. arbi/types/api/chunker_config_param.py +9 -0
  50. arbi/types/api/config_create_params.py +45 -0
  51. arbi/types/api/config_create_response.py +15 -0
  52. arbi/types/api/config_delete_response.py +11 -0
  53. arbi/types/api/config_get_versions_response.py +19 -0
  54. arbi/types/api/config_retrieve_response.py +46 -0
  55. arbi/types/api/conversation/__init__.py +8 -0
  56. arbi/types/api/conversation/user_add_params.py +11 -0
  57. arbi/types/api/conversation/user_add_response.py +11 -0
  58. arbi/types/api/conversation/user_remove_params.py +11 -0
  59. arbi/types/api/conversation/user_remove_response.py +11 -0
  60. arbi/types/api/conversation_delete_message_response.py +11 -0
  61. arbi/types/api/conversation_delete_response.py +11 -0
  62. arbi/types/api/conversation_retrieve_threads_response.py +91 -0
  63. arbi/types/api/conversation_share_response.py +11 -0
  64. arbi/types/api/conversation_update_title_params.py +12 -0
  65. arbi/types/api/conversation_update_title_response.py +13 -0
  66. arbi/types/api/doc_response.py +48 -0
  67. arbi/types/api/document/__init__.py +8 -0
  68. arbi/types/api/document/annotation_create_params.py +16 -0
  69. arbi/types/api/document/annotation_delete_response.py +11 -0
  70. arbi/types/api/document/annotation_update_params.py +16 -0
  71. arbi/types/api/document/doc_tag_response.py +26 -0
  72. arbi/types/api/document_date_extractor_llm_config.py +29 -0
  73. arbi/types/api/document_date_extractor_llm_config_param.py +28 -0
  74. arbi/types/api/document_delete_response.py +11 -0
  75. arbi/types/api/document_get_parsed_response.py +26 -0
  76. arbi/types/api/document_get_tags_response.py +10 -0
  77. arbi/types/api/document_update_params.py +19 -0
  78. arbi/types/api/document_update_response.py +22 -0
  79. arbi/types/api/document_upload_params.py +23 -0
  80. arbi/types/api/document_view_params.py +13 -0
  81. arbi/types/api/embedder_config.py +18 -0
  82. arbi/types/api/embedder_config_param.py +17 -0
  83. arbi/types/api/health_check_app_response.py +9 -0
  84. arbi/types/api/health_check_models_response.py +21 -0
  85. arbi/types/api/health_check_services_response.py +23 -0
  86. arbi/types/api/health_get_models_response.py +19 -0
  87. arbi/types/api/model_citation_config.py +23 -0
  88. arbi/types/api/model_citation_config_param.py +23 -0
  89. arbi/types/api/parser_config_param.py +9 -0
  90. arbi/types/api/query_llm_config.py +30 -0
  91. arbi/types/api/query_llm_config_param.py +29 -0
  92. arbi/types/api/reranker_config.py +21 -0
  93. arbi/types/api/reranker_config_param.py +20 -0
  94. arbi/types/api/retriever_config.py +23 -0
  95. arbi/types/api/retriever_config_param.py +23 -0
  96. arbi/types/api/sso_invite_params.py +11 -0
  97. arbi/types/api/sso_invite_response.py +11 -0
  98. arbi/types/api/sso_login_params.py +16 -0
  99. arbi/types/api/sso_login_response.py +15 -0
  100. arbi/types/api/sso_rotate_passcode_response.py +11 -0
  101. arbi/types/api/tag_apply_to_docs_params.py +12 -0
  102. arbi/types/api/tag_apply_to_docs_response.py +13 -0
  103. arbi/types/api/tag_create_params.py +18 -0
  104. arbi/types/api/tag_create_response.py +11 -0
  105. arbi/types/api/tag_delete_response.py +9 -0
  106. arbi/types/api/tag_get_docs_response.py +10 -0
  107. arbi/types/api/tag_remove_from_docs_params.py +12 -0
  108. arbi/types/api/tag_remove_from_docs_response.py +13 -0
  109. arbi/types/api/tag_update_params.py +14 -0
  110. arbi/types/api/tag_update_response.py +17 -0
  111. arbi/types/api/title_llm_config.py +29 -0
  112. arbi/types/api/title_llm_config_param.py +28 -0
  113. arbi/types/api/token.py +13 -0
  114. arbi/types/api/user/__init__.py +6 -0
  115. arbi/types/api/user/setting_retrieve_response.py +36 -0
  116. arbi/types/api/user/setting_update_params.py +24 -0
  117. arbi/types/api/user_list_workspaces_response.py +10 -0
  118. arbi/types/api/user_login_params.py +13 -0
  119. arbi/types/api/user_logout_response.py +9 -0
  120. arbi/types/api/user_register_params.py +17 -0
  121. arbi/types/api/user_response.py +19 -0
  122. arbi/types/api/workspace_create_protected_params.py +14 -0
  123. arbi/types/api/workspace_delete_response.py +9 -0
  124. arbi/types/api/workspace_get_conversations_response.py +28 -0
  125. arbi/types/api/workspace_get_doctags_response.py +10 -0
  126. arbi/types/api/workspace_get_documents_response.py +10 -0
  127. arbi/types/api/workspace_get_stats_response.py +13 -0
  128. arbi/types/api/workspace_get_tags_response.py +30 -0
  129. arbi/types/api/workspace_get_users_response.py +17 -0
  130. arbi/types/api/workspace_remove_user_params.py +11 -0
  131. arbi/types/api/workspace_remove_user_response.py +11 -0
  132. arbi/types/api/workspace_response.py +24 -0
  133. arbi/types/api/workspace_share_params.py +11 -0
  134. arbi/types/api/workspace_share_response.py +21 -0
  135. arbi/types/api/workspace_update_params.py +14 -0
  136. arbi/types/chunk.py +12 -0
  137. arbi/types/chunk_metadata.py +31 -0
  138. arbi/types/chunk_metadata_param.py +32 -0
  139. arbi/types/chunk_param.py +15 -0
  140. arbi-0.1.0.dist-info/METADATA +410 -0
  141. arbi-0.1.0.dist-info/RECORD +143 -0
  142. arbi-0.1.0.dist-info/WHEEL +4 -0
  143. arbi-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,499 @@
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 Any, Optional, cast
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 (
20
+ config_create_params,
21
+ )
22
+ from ..._base_client import make_request_options
23
+ from ...types.api.parser_config_param import ParserConfigParam
24
+ from ...types.api.chunker_config_param import ChunkerConfigParam
25
+ from ...types.api.embedder_config_param import EmbedderConfigParam
26
+ from ...types.api.reranker_config_param import RerankerConfigParam
27
+ from ...types.api.config_create_response import ConfigCreateResponse
28
+ from ...types.api.config_delete_response import ConfigDeleteResponse
29
+ from ...types.api.query_llm_config_param import QueryLlmConfigParam
30
+ from ...types.api.retriever_config_param import RetrieverConfigParam
31
+ from ...types.api.title_llm_config_param import TitleLlmConfigParam
32
+ from ...types.api.config_retrieve_response import ConfigRetrieveResponse
33
+ from ...types.api.model_citation_config_param import ModelCitationConfigParam
34
+ from ...types.api.config_get_versions_response import ConfigGetVersionsResponse
35
+ from ...types.api.document_date_extractor_llm_config_param import DocumentDateExtractorLlmConfigParam
36
+
37
+ __all__ = ["ConfigsResource", "AsyncConfigsResource"]
38
+
39
+
40
+ class ConfigsResource(SyncAPIResource):
41
+ @cached_property
42
+ def with_raw_response(self) -> ConfigsResourceWithRawResponse:
43
+ """
44
+ This property can be used as a prefix for any HTTP method call to return
45
+ the raw response object instead of the parsed content.
46
+
47
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
48
+ """
49
+ return ConfigsResourceWithRawResponse(self)
50
+
51
+ @cached_property
52
+ def with_streaming_response(self) -> ConfigsResourceWithStreamingResponse:
53
+ """
54
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
55
+
56
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
57
+ """
58
+ return ConfigsResourceWithStreamingResponse(self)
59
+
60
+ def create(
61
+ self,
62
+ *,
63
+ chunker: Optional[ChunkerConfigParam] | NotGiven = NOT_GIVEN,
64
+ document_date_extractor_llm: Optional[DocumentDateExtractorLlmConfigParam] | NotGiven = NOT_GIVEN,
65
+ embedder: Optional[EmbedderConfigParam] | NotGiven = NOT_GIVEN,
66
+ model_citation: Optional[ModelCitationConfigParam] | NotGiven = NOT_GIVEN,
67
+ parent_message_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
68
+ parser: Optional[ParserConfigParam] | NotGiven = NOT_GIVEN,
69
+ query_llm: Optional[QueryLlmConfigParam] | NotGiven = NOT_GIVEN,
70
+ reranker: Optional[RerankerConfigParam] | NotGiven = NOT_GIVEN,
71
+ retriever: Optional[RetrieverConfigParam] | NotGiven = NOT_GIVEN,
72
+ title: str | NotGiven = NOT_GIVEN,
73
+ title_llm: Optional[TitleLlmConfigParam] | NotGiven = NOT_GIVEN,
74
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
75
+ # The extra values given here take precedence over values defined on the client or passed to this method.
76
+ extra_headers: Headers | None = None,
77
+ extra_query: Query | None = None,
78
+ extra_body: Body | None = None,
79
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
80
+ ) -> ConfigCreateResponse:
81
+ """
82
+ Save a new configuration.
83
+
84
+ Args:
85
+ extra_headers: Send extra headers
86
+
87
+ extra_query: Add additional query parameters to the request
88
+
89
+ extra_body: Add additional JSON properties to the request
90
+
91
+ timeout: Override the client-level default timeout for this request, in seconds
92
+ """
93
+ return self._post(
94
+ "/api/configs/",
95
+ body=maybe_transform(
96
+ {
97
+ "chunker": chunker,
98
+ "document_date_extractor_llm": document_date_extractor_llm,
99
+ "embedder": embedder,
100
+ "model_citation": model_citation,
101
+ "parent_message_ext_id": parent_message_ext_id,
102
+ "parser": parser,
103
+ "query_llm": query_llm,
104
+ "reranker": reranker,
105
+ "retriever": retriever,
106
+ "title": title,
107
+ "title_llm": title_llm,
108
+ },
109
+ config_create_params.ConfigCreateParams,
110
+ ),
111
+ options=make_request_options(
112
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
113
+ ),
114
+ cast_to=ConfigCreateResponse,
115
+ )
116
+
117
+ def retrieve(
118
+ self,
119
+ config_ext_id: str,
120
+ *,
121
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
122
+ # The extra values given here take precedence over values defined on the client or passed to this method.
123
+ extra_headers: Headers | None = None,
124
+ extra_query: Query | None = None,
125
+ extra_body: Body | None = None,
126
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
127
+ ) -> ConfigRetrieveResponse:
128
+ """
129
+ Read configurations from database to be displayed in the UI
130
+
131
+ Args:
132
+ config_ext_id: Config name: 'cfg-XXXXXXXX' or 'default' for system default
133
+
134
+ extra_headers: Send extra headers
135
+
136
+ extra_query: Add additional query parameters to the request
137
+
138
+ extra_body: Add additional JSON properties to the request
139
+
140
+ timeout: Override the client-level default timeout for this request, in seconds
141
+ """
142
+ if not config_ext_id:
143
+ raise ValueError(f"Expected a non-empty value for `config_ext_id` but received {config_ext_id!r}")
144
+ return cast(
145
+ ConfigRetrieveResponse,
146
+ self._get(
147
+ f"/api/configs/{config_ext_id}",
148
+ options=make_request_options(
149
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
150
+ ),
151
+ cast_to=cast(
152
+ Any, ConfigRetrieveResponse
153
+ ), # Union types cannot be passed in as arguments in the type system
154
+ ),
155
+ )
156
+
157
+ def delete(
158
+ self,
159
+ config_ext_id: str,
160
+ *,
161
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
162
+ # The extra values given here take precedence over values defined on the client or passed to this method.
163
+ extra_headers: Headers | None = None,
164
+ extra_query: Query | None = None,
165
+ extra_body: Body | None = None,
166
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
167
+ ) -> ConfigDeleteResponse:
168
+ """
169
+ Delete a specific configuration from database
170
+
171
+ Args:
172
+ extra_headers: Send extra headers
173
+
174
+ extra_query: Add additional query parameters to the request
175
+
176
+ extra_body: Add additional JSON properties to the request
177
+
178
+ timeout: Override the client-level default timeout for this request, in seconds
179
+ """
180
+ if not config_ext_id:
181
+ raise ValueError(f"Expected a non-empty value for `config_ext_id` but received {config_ext_id!r}")
182
+ return self._delete(
183
+ f"/api/configs/{config_ext_id}",
184
+ options=make_request_options(
185
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
186
+ ),
187
+ cast_to=ConfigDeleteResponse,
188
+ )
189
+
190
+ def get_schema(
191
+ self,
192
+ *,
193
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194
+ # The extra values given here take precedence over values defined on the client or passed to this method.
195
+ extra_headers: Headers | None = None,
196
+ extra_query: Query | None = None,
197
+ extra_body: Body | None = None,
198
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
199
+ ) -> object:
200
+ """Return the JSON schema for all config models"""
201
+ return self._get(
202
+ "/api/configs/schema",
203
+ options=make_request_options(
204
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
205
+ ),
206
+ cast_to=object,
207
+ )
208
+
209
+ def get_versions(
210
+ self,
211
+ *,
212
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
213
+ # The extra values given here take precedence over values defined on the client or passed to this method.
214
+ extra_headers: Headers | None = None,
215
+ extra_query: Query | None = None,
216
+ extra_body: Body | None = None,
217
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
218
+ ) -> ConfigGetVersionsResponse:
219
+ """Returns a list of available configuration versions for the current user"""
220
+ return self._get(
221
+ "/api/configs/versions",
222
+ options=make_request_options(
223
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
224
+ ),
225
+ cast_to=ConfigGetVersionsResponse,
226
+ )
227
+
228
+
229
+ class AsyncConfigsResource(AsyncAPIResource):
230
+ @cached_property
231
+ def with_raw_response(self) -> AsyncConfigsResourceWithRawResponse:
232
+ """
233
+ This property can be used as a prefix for any HTTP method call to return
234
+ the raw response object instead of the parsed content.
235
+
236
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#accessing-raw-response-data-eg-headers
237
+ """
238
+ return AsyncConfigsResourceWithRawResponse(self)
239
+
240
+ @cached_property
241
+ def with_streaming_response(self) -> AsyncConfigsResourceWithStreamingResponse:
242
+ """
243
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
244
+
245
+ For more information, see https://www.github.com/arbitrationcity/arbi-python#with_streaming_response
246
+ """
247
+ return AsyncConfigsResourceWithStreamingResponse(self)
248
+
249
+ async def create(
250
+ self,
251
+ *,
252
+ chunker: Optional[ChunkerConfigParam] | NotGiven = NOT_GIVEN,
253
+ document_date_extractor_llm: Optional[DocumentDateExtractorLlmConfigParam] | NotGiven = NOT_GIVEN,
254
+ embedder: Optional[EmbedderConfigParam] | NotGiven = NOT_GIVEN,
255
+ model_citation: Optional[ModelCitationConfigParam] | NotGiven = NOT_GIVEN,
256
+ parent_message_ext_id: Optional[str] | NotGiven = NOT_GIVEN,
257
+ parser: Optional[ParserConfigParam] | NotGiven = NOT_GIVEN,
258
+ query_llm: Optional[QueryLlmConfigParam] | NotGiven = NOT_GIVEN,
259
+ reranker: Optional[RerankerConfigParam] | NotGiven = NOT_GIVEN,
260
+ retriever: Optional[RetrieverConfigParam] | NotGiven = NOT_GIVEN,
261
+ title: str | NotGiven = NOT_GIVEN,
262
+ title_llm: Optional[TitleLlmConfigParam] | NotGiven = NOT_GIVEN,
263
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
264
+ # The extra values given here take precedence over values defined on the client or passed to this method.
265
+ extra_headers: Headers | None = None,
266
+ extra_query: Query | None = None,
267
+ extra_body: Body | None = None,
268
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
269
+ ) -> ConfigCreateResponse:
270
+ """
271
+ Save a new configuration.
272
+
273
+ Args:
274
+ extra_headers: Send extra headers
275
+
276
+ extra_query: Add additional query parameters to the request
277
+
278
+ extra_body: Add additional JSON properties to the request
279
+
280
+ timeout: Override the client-level default timeout for this request, in seconds
281
+ """
282
+ return await self._post(
283
+ "/api/configs/",
284
+ body=await async_maybe_transform(
285
+ {
286
+ "chunker": chunker,
287
+ "document_date_extractor_llm": document_date_extractor_llm,
288
+ "embedder": embedder,
289
+ "model_citation": model_citation,
290
+ "parent_message_ext_id": parent_message_ext_id,
291
+ "parser": parser,
292
+ "query_llm": query_llm,
293
+ "reranker": reranker,
294
+ "retriever": retriever,
295
+ "title": title,
296
+ "title_llm": title_llm,
297
+ },
298
+ config_create_params.ConfigCreateParams,
299
+ ),
300
+ options=make_request_options(
301
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
302
+ ),
303
+ cast_to=ConfigCreateResponse,
304
+ )
305
+
306
+ async def retrieve(
307
+ self,
308
+ config_ext_id: str,
309
+ *,
310
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
311
+ # The extra values given here take precedence over values defined on the client or passed to this method.
312
+ extra_headers: Headers | None = None,
313
+ extra_query: Query | None = None,
314
+ extra_body: Body | None = None,
315
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
316
+ ) -> ConfigRetrieveResponse:
317
+ """
318
+ Read configurations from database to be displayed in the UI
319
+
320
+ Args:
321
+ config_ext_id: Config name: 'cfg-XXXXXXXX' or 'default' for system default
322
+
323
+ extra_headers: Send extra headers
324
+
325
+ extra_query: Add additional query parameters to the request
326
+
327
+ extra_body: Add additional JSON properties to the request
328
+
329
+ timeout: Override the client-level default timeout for this request, in seconds
330
+ """
331
+ if not config_ext_id:
332
+ raise ValueError(f"Expected a non-empty value for `config_ext_id` but received {config_ext_id!r}")
333
+ return cast(
334
+ ConfigRetrieveResponse,
335
+ await self._get(
336
+ f"/api/configs/{config_ext_id}",
337
+ options=make_request_options(
338
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
339
+ ),
340
+ cast_to=cast(
341
+ Any, ConfigRetrieveResponse
342
+ ), # Union types cannot be passed in as arguments in the type system
343
+ ),
344
+ )
345
+
346
+ async def delete(
347
+ self,
348
+ config_ext_id: str,
349
+ *,
350
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
351
+ # The extra values given here take precedence over values defined on the client or passed to this method.
352
+ extra_headers: Headers | None = None,
353
+ extra_query: Query | None = None,
354
+ extra_body: Body | None = None,
355
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
356
+ ) -> ConfigDeleteResponse:
357
+ """
358
+ Delete a specific configuration from database
359
+
360
+ Args:
361
+ extra_headers: Send extra headers
362
+
363
+ extra_query: Add additional query parameters to the request
364
+
365
+ extra_body: Add additional JSON properties to the request
366
+
367
+ timeout: Override the client-level default timeout for this request, in seconds
368
+ """
369
+ if not config_ext_id:
370
+ raise ValueError(f"Expected a non-empty value for `config_ext_id` but received {config_ext_id!r}")
371
+ return await self._delete(
372
+ f"/api/configs/{config_ext_id}",
373
+ options=make_request_options(
374
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
375
+ ),
376
+ cast_to=ConfigDeleteResponse,
377
+ )
378
+
379
+ async def get_schema(
380
+ self,
381
+ *,
382
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
383
+ # The extra values given here take precedence over values defined on the client or passed to this method.
384
+ extra_headers: Headers | None = None,
385
+ extra_query: Query | None = None,
386
+ extra_body: Body | None = None,
387
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
388
+ ) -> object:
389
+ """Return the JSON schema for all config models"""
390
+ return await self._get(
391
+ "/api/configs/schema",
392
+ options=make_request_options(
393
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
394
+ ),
395
+ cast_to=object,
396
+ )
397
+
398
+ async def get_versions(
399
+ self,
400
+ *,
401
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
402
+ # The extra values given here take precedence over values defined on the client or passed to this method.
403
+ extra_headers: Headers | None = None,
404
+ extra_query: Query | None = None,
405
+ extra_body: Body | None = None,
406
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
407
+ ) -> ConfigGetVersionsResponse:
408
+ """Returns a list of available configuration versions for the current user"""
409
+ return await self._get(
410
+ "/api/configs/versions",
411
+ options=make_request_options(
412
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
413
+ ),
414
+ cast_to=ConfigGetVersionsResponse,
415
+ )
416
+
417
+
418
+ class ConfigsResourceWithRawResponse:
419
+ def __init__(self, configs: ConfigsResource) -> None:
420
+ self._configs = configs
421
+
422
+ self.create = to_raw_response_wrapper(
423
+ configs.create,
424
+ )
425
+ self.retrieve = to_raw_response_wrapper(
426
+ configs.retrieve,
427
+ )
428
+ self.delete = to_raw_response_wrapper(
429
+ configs.delete,
430
+ )
431
+ self.get_schema = to_raw_response_wrapper(
432
+ configs.get_schema,
433
+ )
434
+ self.get_versions = to_raw_response_wrapper(
435
+ configs.get_versions,
436
+ )
437
+
438
+
439
+ class AsyncConfigsResourceWithRawResponse:
440
+ def __init__(self, configs: AsyncConfigsResource) -> None:
441
+ self._configs = configs
442
+
443
+ self.create = async_to_raw_response_wrapper(
444
+ configs.create,
445
+ )
446
+ self.retrieve = async_to_raw_response_wrapper(
447
+ configs.retrieve,
448
+ )
449
+ self.delete = async_to_raw_response_wrapper(
450
+ configs.delete,
451
+ )
452
+ self.get_schema = async_to_raw_response_wrapper(
453
+ configs.get_schema,
454
+ )
455
+ self.get_versions = async_to_raw_response_wrapper(
456
+ configs.get_versions,
457
+ )
458
+
459
+
460
+ class ConfigsResourceWithStreamingResponse:
461
+ def __init__(self, configs: ConfigsResource) -> None:
462
+ self._configs = configs
463
+
464
+ self.create = to_streamed_response_wrapper(
465
+ configs.create,
466
+ )
467
+ self.retrieve = to_streamed_response_wrapper(
468
+ configs.retrieve,
469
+ )
470
+ self.delete = to_streamed_response_wrapper(
471
+ configs.delete,
472
+ )
473
+ self.get_schema = to_streamed_response_wrapper(
474
+ configs.get_schema,
475
+ )
476
+ self.get_versions = to_streamed_response_wrapper(
477
+ configs.get_versions,
478
+ )
479
+
480
+
481
+ class AsyncConfigsResourceWithStreamingResponse:
482
+ def __init__(self, configs: AsyncConfigsResource) -> None:
483
+ self._configs = configs
484
+
485
+ self.create = async_to_streamed_response_wrapper(
486
+ configs.create,
487
+ )
488
+ self.retrieve = async_to_streamed_response_wrapper(
489
+ configs.retrieve,
490
+ )
491
+ self.delete = async_to_streamed_response_wrapper(
492
+ configs.delete,
493
+ )
494
+ self.get_schema = async_to_streamed_response_wrapper(
495
+ configs.get_schema,
496
+ )
497
+ self.get_versions = async_to_streamed_response_wrapper(
498
+ configs.get_versions,
499
+ )
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .user import (
4
+ UserResource,
5
+ AsyncUserResource,
6
+ UserResourceWithRawResponse,
7
+ AsyncUserResourceWithRawResponse,
8
+ UserResourceWithStreamingResponse,
9
+ AsyncUserResourceWithStreamingResponse,
10
+ )
11
+ from .conversation import (
12
+ ConversationResource,
13
+ AsyncConversationResource,
14
+ ConversationResourceWithRawResponse,
15
+ AsyncConversationResourceWithRawResponse,
16
+ ConversationResourceWithStreamingResponse,
17
+ AsyncConversationResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "UserResource",
22
+ "AsyncUserResource",
23
+ "UserResourceWithRawResponse",
24
+ "AsyncUserResourceWithRawResponse",
25
+ "UserResourceWithStreamingResponse",
26
+ "AsyncUserResourceWithStreamingResponse",
27
+ "ConversationResource",
28
+ "AsyncConversationResource",
29
+ "ConversationResourceWithRawResponse",
30
+ "AsyncConversationResourceWithRawResponse",
31
+ "ConversationResourceWithStreamingResponse",
32
+ "AsyncConversationResourceWithStreamingResponse",
33
+ ]