admin-api-lib 3.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.
Files changed (106) hide show
  1. admin_api_lib/__init__.py +0 -0
  2. admin_api_lib/api_endpoints/document_deleter.py +24 -0
  3. admin_api_lib/api_endpoints/document_reference_retriever.py +25 -0
  4. admin_api_lib/api_endpoints/documents_status_retriever.py +20 -0
  5. admin_api_lib/api_endpoints/file_uploader.py +31 -0
  6. admin_api_lib/api_endpoints/source_uploader.py +40 -0
  7. admin_api_lib/api_endpoints/uploader_base.py +30 -0
  8. admin_api_lib/apis/__init__.py +0 -0
  9. admin_api_lib/apis/admin_api.py +197 -0
  10. admin_api_lib/apis/admin_api_base.py +120 -0
  11. admin_api_lib/chunker/__init__.py +0 -0
  12. admin_api_lib/chunker/chunker.py +25 -0
  13. admin_api_lib/dependency_container.py +236 -0
  14. admin_api_lib/extractor_api_client/__init__.py +0 -0
  15. admin_api_lib/extractor_api_client/openapi_client/__init__.py +38 -0
  16. admin_api_lib/extractor_api_client/openapi_client/api/__init__.py +4 -0
  17. admin_api_lib/extractor_api_client/openapi_client/api/extractor_api.py +516 -0
  18. admin_api_lib/extractor_api_client/openapi_client/api_client.py +695 -0
  19. admin_api_lib/extractor_api_client/openapi_client/api_response.py +20 -0
  20. admin_api_lib/extractor_api_client/openapi_client/configuration.py +460 -0
  21. admin_api_lib/extractor_api_client/openapi_client/exceptions.py +197 -0
  22. admin_api_lib/extractor_api_client/openapi_client/models/__init__.py +21 -0
  23. admin_api_lib/extractor_api_client/openapi_client/models/content_type.py +34 -0
  24. admin_api_lib/extractor_api_client/openapi_client/models/extraction_parameters.py +103 -0
  25. admin_api_lib/extractor_api_client/openapi_client/models/extraction_request.py +82 -0
  26. admin_api_lib/extractor_api_client/openapi_client/models/information_piece.py +104 -0
  27. admin_api_lib/extractor_api_client/openapi_client/models/key_value_pair.py +92 -0
  28. admin_api_lib/extractor_api_client/openapi_client/rest.py +209 -0
  29. admin_api_lib/extractor_api_client/openapi_client/test/__init__.py +0 -0
  30. admin_api_lib/extractor_api_client/openapi_client/test/test_content_type.py +35 -0
  31. admin_api_lib/extractor_api_client/openapi_client/test/test_extraction_parameters.py +59 -0
  32. admin_api_lib/extractor_api_client/openapi_client/test/test_extraction_request.py +56 -0
  33. admin_api_lib/extractor_api_client/openapi_client/test/test_extractor_api.py +39 -0
  34. admin_api_lib/extractor_api_client/openapi_client/test/test_information_piece.py +62 -0
  35. admin_api_lib/extractor_api_client/openapi_client/test/test_key_value_pair.py +54 -0
  36. admin_api_lib/file_services/file_service.py +77 -0
  37. admin_api_lib/impl/__init__.py +0 -0
  38. admin_api_lib/impl/admin_api.py +167 -0
  39. admin_api_lib/impl/api_endpoints/default_document_deleter.py +84 -0
  40. admin_api_lib/impl/api_endpoints/default_document_reference_retriever.py +72 -0
  41. admin_api_lib/impl/api_endpoints/default_documents_status_retriever.py +41 -0
  42. admin_api_lib/impl/api_endpoints/default_file_uploader.py +234 -0
  43. admin_api_lib/impl/api_endpoints/default_source_uploader.py +202 -0
  44. admin_api_lib/impl/chunker/__init__.py +0 -0
  45. admin_api_lib/impl/chunker/chunker_type.py +11 -0
  46. admin_api_lib/impl/chunker/semantic_text_chunker.py +252 -0
  47. admin_api_lib/impl/chunker/text_chunker.py +33 -0
  48. admin_api_lib/impl/file_services/__init__.py +0 -0
  49. admin_api_lib/impl/file_services/s3_service.py +130 -0
  50. admin_api_lib/impl/information_enhancer/__init__.py +0 -0
  51. admin_api_lib/impl/information_enhancer/general_enhancer.py +52 -0
  52. admin_api_lib/impl/information_enhancer/page_summary_enhancer.py +62 -0
  53. admin_api_lib/impl/information_enhancer/summary_enhancer.py +74 -0
  54. admin_api_lib/impl/key_db/__init__.py +0 -0
  55. admin_api_lib/impl/key_db/file_status_key_value_store.py +111 -0
  56. admin_api_lib/impl/mapper/informationpiece2document.py +108 -0
  57. admin_api_lib/impl/settings/__init__.py +0 -0
  58. admin_api_lib/impl/settings/chunker_class_type_settings.py +18 -0
  59. admin_api_lib/impl/settings/chunker_settings.py +29 -0
  60. admin_api_lib/impl/settings/document_extractor_settings.py +21 -0
  61. admin_api_lib/impl/settings/key_value_settings.py +26 -0
  62. admin_api_lib/impl/settings/rag_api_settings.py +21 -0
  63. admin_api_lib/impl/settings/s3_settings.py +31 -0
  64. admin_api_lib/impl/settings/source_uploader_settings.py +23 -0
  65. admin_api_lib/impl/settings/summarizer_settings.py +86 -0
  66. admin_api_lib/impl/summarizer/__init__.py +0 -0
  67. admin_api_lib/impl/summarizer/langchain_summarizer.py +117 -0
  68. admin_api_lib/information_enhancer/__init__.py +0 -0
  69. admin_api_lib/information_enhancer/information_enhancer.py +34 -0
  70. admin_api_lib/main.py +54 -0
  71. admin_api_lib/models/__init__.py +0 -0
  72. admin_api_lib/models/document_status.py +86 -0
  73. admin_api_lib/models/extra_models.py +9 -0
  74. admin_api_lib/models/http_validation_error.py +105 -0
  75. admin_api_lib/models/key_value_pair.py +85 -0
  76. admin_api_lib/models/status.py +44 -0
  77. admin_api_lib/models/validation_error.py +104 -0
  78. admin_api_lib/models/validation_error_loc_inner.py +114 -0
  79. admin_api_lib/prompt_templates/__init__.py +0 -0
  80. admin_api_lib/prompt_templates/summarize_prompt.py +14 -0
  81. admin_api_lib/rag_backend_client/__init__.py +0 -0
  82. admin_api_lib/rag_backend_client/openapi_client/__init__.py +60 -0
  83. admin_api_lib/rag_backend_client/openapi_client/api/__init__.py +4 -0
  84. admin_api_lib/rag_backend_client/openapi_client/api/rag_api.py +968 -0
  85. admin_api_lib/rag_backend_client/openapi_client/api_client.py +698 -0
  86. admin_api_lib/rag_backend_client/openapi_client/api_response.py +22 -0
  87. admin_api_lib/rag_backend_client/openapi_client/configuration.py +460 -0
  88. admin_api_lib/rag_backend_client/openapi_client/exceptions.py +197 -0
  89. admin_api_lib/rag_backend_client/openapi_client/models/__init__.py +41 -0
  90. admin_api_lib/rag_backend_client/openapi_client/models/chat_history.py +99 -0
  91. admin_api_lib/rag_backend_client/openapi_client/models/chat_history_message.py +83 -0
  92. admin_api_lib/rag_backend_client/openapi_client/models/chat_request.py +93 -0
  93. admin_api_lib/rag_backend_client/openapi_client/models/chat_response.py +103 -0
  94. admin_api_lib/rag_backend_client/openapi_client/models/chat_role.py +35 -0
  95. admin_api_lib/rag_backend_client/openapi_client/models/content_type.py +37 -0
  96. admin_api_lib/rag_backend_client/openapi_client/models/delete_request.py +99 -0
  97. admin_api_lib/rag_backend_client/openapi_client/models/information_piece.py +110 -0
  98. admin_api_lib/rag_backend_client/openapi_client/models/key_value_pair.py +83 -0
  99. admin_api_lib/rag_backend_client/openapi_client/rest.py +209 -0
  100. admin_api_lib/summarizer/__init__.py +0 -0
  101. admin_api_lib/summarizer/summarizer.py +33 -0
  102. admin_api_lib/utils/__init__.py +0 -0
  103. admin_api_lib/utils/utils.py +32 -0
  104. admin_api_lib-3.2.0.dist-info/METADATA +24 -0
  105. admin_api_lib-3.2.0.dist-info/RECORD +106 -0
  106. admin_api_lib-3.2.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,968 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT RAG
5
+
6
+ The perfect rag solution.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from typing import Any, Dict, List, Optional, Tuple, Union
16
+
17
+ from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
18
+ from typing_extensions import Annotated
19
+
20
+ from admin_api_lib.rag_backend_client.openapi_client.api_client import (
21
+ ApiClient,
22
+ RequestSerialized,
23
+ )
24
+ from admin_api_lib.rag_backend_client.openapi_client.api_response import ApiResponse
25
+ from admin_api_lib.rag_backend_client.openapi_client.models.chat_request import (
26
+ ChatRequest,
27
+ )
28
+ from admin_api_lib.rag_backend_client.openapi_client.models.chat_response import (
29
+ ChatResponse,
30
+ )
31
+ from admin_api_lib.rag_backend_client.openapi_client.models.delete_request import (
32
+ DeleteRequest,
33
+ )
34
+ from admin_api_lib.rag_backend_client.openapi_client.models.information_piece import (
35
+ InformationPiece,
36
+ )
37
+ from admin_api_lib.rag_backend_client.openapi_client.rest import RESTResponseType
38
+
39
+
40
+ class RagApi:
41
+ """NOTE: This class is auto generated by OpenAPI Generator
42
+ Ref: https://openapi-generator.tech
43
+
44
+ Do not edit the class manually.
45
+ """
46
+
47
+ def __init__(self, api_client=None) -> None:
48
+ if api_client is None:
49
+ api_client = ApiClient.get_default()
50
+ self.api_client = api_client
51
+
52
+ @validate_call
53
+ def chat(
54
+ self,
55
+ session_id: StrictStr,
56
+ chat_request: Annotated[ChatRequest, Field(description="Chat with RAG.")],
57
+ _request_timeout: Union[
58
+ None,
59
+ Annotated[StrictFloat, Field(gt=0)],
60
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
61
+ ] = None,
62
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
63
+ _content_type: Optional[StrictStr] = None,
64
+ _headers: Optional[Dict[StrictStr, Any]] = None,
65
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
66
+ ) -> ChatResponse:
67
+ """chat
68
+
69
+
70
+ :param session_id: (required)
71
+ :type session_id: str
72
+ :param chat_request: Chat with RAG. (required)
73
+ :type chat_request: ChatRequest
74
+ :param _request_timeout: timeout setting for this request. If one
75
+ number provided, it will be total request
76
+ timeout. It can also be a pair (tuple) of
77
+ (connection, read) timeouts.
78
+ :type _request_timeout: int, tuple(int, int), optional
79
+ :param _request_auth: set to override the auth_settings for an a single
80
+ request; this effectively ignores the
81
+ authentication in the spec for a single request.
82
+ :type _request_auth: dict, optional
83
+ :param _content_type: force content-type for the request.
84
+ :type _content_type: str, Optional
85
+ :param _headers: set to override the headers for a single
86
+ request; this effectively ignores the headers
87
+ in the spec for a single request.
88
+ :type _headers: dict, optional
89
+ :param _host_index: set to override the host_index for a single
90
+ request; this effectively ignores the host_index
91
+ in the spec for a single request.
92
+ :type _host_index: int, optional
93
+ :return: Returns the result object.
94
+ """ # noqa: E501
95
+
96
+ _param = self._chat_serialize(
97
+ session_id=session_id,
98
+ chat_request=chat_request,
99
+ _request_auth=_request_auth,
100
+ _content_type=_content_type,
101
+ _headers=_headers,
102
+ _host_index=_host_index,
103
+ )
104
+
105
+ _response_types_map: Dict[str, Optional[str]] = {
106
+ "200": "ChatResponse",
107
+ "500": None,
108
+ }
109
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
110
+ response_data.read()
111
+ return self.api_client.response_deserialize(
112
+ response_data=response_data,
113
+ response_types_map=_response_types_map,
114
+ ).data
115
+
116
+ @validate_call
117
+ def chat_with_http_info(
118
+ self,
119
+ session_id: StrictStr,
120
+ chat_request: Annotated[ChatRequest, Field(description="Chat with RAG.")],
121
+ _request_timeout: Union[
122
+ None,
123
+ Annotated[StrictFloat, Field(gt=0)],
124
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
125
+ ] = None,
126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
+ _content_type: Optional[StrictStr] = None,
128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
+ ) -> ApiResponse[ChatResponse]:
131
+ """chat
132
+
133
+
134
+ :param session_id: (required)
135
+ :type session_id: str
136
+ :param chat_request: Chat with RAG. (required)
137
+ :type chat_request: ChatRequest
138
+ :param _request_timeout: timeout setting for this request. If one
139
+ number provided, it will be total request
140
+ timeout. It can also be a pair (tuple) of
141
+ (connection, read) timeouts.
142
+ :type _request_timeout: int, tuple(int, int), optional
143
+ :param _request_auth: set to override the auth_settings for an a single
144
+ request; this effectively ignores the
145
+ authentication in the spec for a single request.
146
+ :type _request_auth: dict, optional
147
+ :param _content_type: force content-type for the request.
148
+ :type _content_type: str, Optional
149
+ :param _headers: set to override the headers for a single
150
+ request; this effectively ignores the headers
151
+ in the spec for a single request.
152
+ :type _headers: dict, optional
153
+ :param _host_index: set to override the host_index for a single
154
+ request; this effectively ignores the host_index
155
+ in the spec for a single request.
156
+ :type _host_index: int, optional
157
+ :return: Returns the result object.
158
+ """ # noqa: E501
159
+
160
+ _param = self._chat_serialize(
161
+ session_id=session_id,
162
+ chat_request=chat_request,
163
+ _request_auth=_request_auth,
164
+ _content_type=_content_type,
165
+ _headers=_headers,
166
+ _host_index=_host_index,
167
+ )
168
+
169
+ _response_types_map: Dict[str, Optional[str]] = {
170
+ "200": "ChatResponse",
171
+ "500": None,
172
+ }
173
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
174
+ response_data.read()
175
+ return self.api_client.response_deserialize(
176
+ response_data=response_data,
177
+ response_types_map=_response_types_map,
178
+ )
179
+
180
+ @validate_call
181
+ def chat_without_preload_content(
182
+ self,
183
+ session_id: StrictStr,
184
+ chat_request: Annotated[ChatRequest, Field(description="Chat with RAG.")],
185
+ _request_timeout: Union[
186
+ None,
187
+ Annotated[StrictFloat, Field(gt=0)],
188
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
189
+ ] = None,
190
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
191
+ _content_type: Optional[StrictStr] = None,
192
+ _headers: Optional[Dict[StrictStr, Any]] = None,
193
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
194
+ ) -> RESTResponseType:
195
+ """chat
196
+
197
+
198
+ :param session_id: (required)
199
+ :type session_id: str
200
+ :param chat_request: Chat with RAG. (required)
201
+ :type chat_request: ChatRequest
202
+ :param _request_timeout: timeout setting for this request. If one
203
+ number provided, it will be total request
204
+ timeout. It can also be a pair (tuple) of
205
+ (connection, read) timeouts.
206
+ :type _request_timeout: int, tuple(int, int), optional
207
+ :param _request_auth: set to override the auth_settings for an a single
208
+ request; this effectively ignores the
209
+ authentication in the spec for a single request.
210
+ :type _request_auth: dict, optional
211
+ :param _content_type: force content-type for the request.
212
+ :type _content_type: str, Optional
213
+ :param _headers: set to override the headers for a single
214
+ request; this effectively ignores the headers
215
+ in the spec for a single request.
216
+ :type _headers: dict, optional
217
+ :param _host_index: set to override the host_index for a single
218
+ request; this effectively ignores the host_index
219
+ in the spec for a single request.
220
+ :type _host_index: int, optional
221
+ :return: Returns the result object.
222
+ """ # noqa: E501
223
+
224
+ _param = self._chat_serialize(
225
+ session_id=session_id,
226
+ chat_request=chat_request,
227
+ _request_auth=_request_auth,
228
+ _content_type=_content_type,
229
+ _headers=_headers,
230
+ _host_index=_host_index,
231
+ )
232
+
233
+ _response_types_map: Dict[str, Optional[str]] = {
234
+ "200": "ChatResponse",
235
+ "500": None,
236
+ }
237
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
238
+ return response_data.response
239
+
240
+ def _chat_serialize(
241
+ self,
242
+ session_id,
243
+ chat_request,
244
+ _request_auth,
245
+ _content_type,
246
+ _headers,
247
+ _host_index,
248
+ ) -> RequestSerialized:
249
+ _host = None
250
+
251
+ _collection_formats: Dict[str, str] = {}
252
+
253
+ _path_params: Dict[str, str] = {}
254
+ _query_params: List[Tuple[str, str]] = []
255
+ _header_params: Dict[str, Optional[str]] = _headers or {}
256
+ _form_params: List[Tuple[str, str]] = []
257
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
258
+ _body_params: Optional[bytes] = None
259
+
260
+ # process the path parameters
261
+ if session_id is not None:
262
+ _path_params["session_id"] = session_id
263
+ # process the query parameters
264
+ # process the header parameters
265
+ # process the form parameters
266
+ # process the body parameter
267
+ if chat_request is not None:
268
+ _body_params = chat_request
269
+
270
+ # set the HTTP header `Accept`
271
+ if "Accept" not in _header_params:
272
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
273
+
274
+ # set the HTTP header `Content-Type`
275
+ if _content_type:
276
+ _header_params["Content-Type"] = _content_type
277
+ else:
278
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
279
+ if _default_content_type is not None:
280
+ _header_params["Content-Type"] = _default_content_type
281
+
282
+ # authentication setting
283
+ _auth_settings: List[str] = []
284
+
285
+ return self.api_client.param_serialize(
286
+ method="POST",
287
+ resource_path="/chat/{session_id}",
288
+ path_params=_path_params,
289
+ query_params=_query_params,
290
+ header_params=_header_params,
291
+ body=_body_params,
292
+ post_params=_form_params,
293
+ files=_files,
294
+ auth_settings=_auth_settings,
295
+ collection_formats=_collection_formats,
296
+ _host=_host,
297
+ _request_auth=_request_auth,
298
+ )
299
+
300
+ @validate_call
301
+ def evaluate(
302
+ self,
303
+ _request_timeout: Union[
304
+ None,
305
+ Annotated[StrictFloat, Field(gt=0)],
306
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
307
+ ] = None,
308
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
309
+ _content_type: Optional[StrictStr] = None,
310
+ _headers: Optional[Dict[StrictStr, Any]] = None,
311
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
312
+ ) -> None:
313
+ """evaluate
314
+
315
+
316
+ :param _request_timeout: timeout setting for this request. If one
317
+ number provided, it will be total request
318
+ timeout. It can also be a pair (tuple) of
319
+ (connection, read) timeouts.
320
+ :type _request_timeout: int, tuple(int, int), optional
321
+ :param _request_auth: set to override the auth_settings for an a single
322
+ request; this effectively ignores the
323
+ authentication in the spec for a single request.
324
+ :type _request_auth: dict, optional
325
+ :param _content_type: force content-type for the request.
326
+ :type _content_type: str, Optional
327
+ :param _headers: set to override the headers for a single
328
+ request; this effectively ignores the headers
329
+ in the spec for a single request.
330
+ :type _headers: dict, optional
331
+ :param _host_index: set to override the host_index for a single
332
+ request; this effectively ignores the host_index
333
+ in the spec for a single request.
334
+ :type _host_index: int, optional
335
+ :return: Returns the result object.
336
+ """ # noqa: E501
337
+
338
+ _param = self._evaluate_serialize(
339
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
340
+ )
341
+
342
+ _response_types_map: Dict[str, Optional[str]] = {
343
+ "201": None,
344
+ "500": None,
345
+ }
346
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
347
+ response_data.read()
348
+ return self.api_client.response_deserialize(
349
+ response_data=response_data,
350
+ response_types_map=_response_types_map,
351
+ ).data
352
+
353
+ @validate_call
354
+ def evaluate_with_http_info(
355
+ self,
356
+ _request_timeout: Union[
357
+ None,
358
+ Annotated[StrictFloat, Field(gt=0)],
359
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
360
+ ] = None,
361
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
362
+ _content_type: Optional[StrictStr] = None,
363
+ _headers: Optional[Dict[StrictStr, Any]] = None,
364
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
365
+ ) -> ApiResponse[None]:
366
+ """evaluate
367
+
368
+
369
+ :param _request_timeout: timeout setting for this request. If one
370
+ number provided, it will be total request
371
+ timeout. It can also be a pair (tuple) of
372
+ (connection, read) timeouts.
373
+ :type _request_timeout: int, tuple(int, int), optional
374
+ :param _request_auth: set to override the auth_settings for an a single
375
+ request; this effectively ignores the
376
+ authentication in the spec for a single request.
377
+ :type _request_auth: dict, optional
378
+ :param _content_type: force content-type for the request.
379
+ :type _content_type: str, Optional
380
+ :param _headers: set to override the headers for a single
381
+ request; this effectively ignores the headers
382
+ in the spec for a single request.
383
+ :type _headers: dict, optional
384
+ :param _host_index: set to override the host_index for a single
385
+ request; this effectively ignores the host_index
386
+ in the spec for a single request.
387
+ :type _host_index: int, optional
388
+ :return: Returns the result object.
389
+ """ # noqa: E501
390
+
391
+ _param = self._evaluate_serialize(
392
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
393
+ )
394
+
395
+ _response_types_map: Dict[str, Optional[str]] = {
396
+ "201": None,
397
+ "500": None,
398
+ }
399
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
400
+ response_data.read()
401
+ return self.api_client.response_deserialize(
402
+ response_data=response_data,
403
+ response_types_map=_response_types_map,
404
+ )
405
+
406
+ @validate_call
407
+ def evaluate_without_preload_content(
408
+ self,
409
+ _request_timeout: Union[
410
+ None,
411
+ Annotated[StrictFloat, Field(gt=0)],
412
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
413
+ ] = None,
414
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
415
+ _content_type: Optional[StrictStr] = None,
416
+ _headers: Optional[Dict[StrictStr, Any]] = None,
417
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
418
+ ) -> RESTResponseType:
419
+ """evaluate
420
+
421
+
422
+ :param _request_timeout: timeout setting for this request. If one
423
+ number provided, it will be total request
424
+ timeout. It can also be a pair (tuple) of
425
+ (connection, read) timeouts.
426
+ :type _request_timeout: int, tuple(int, int), optional
427
+ :param _request_auth: set to override the auth_settings for an a single
428
+ request; this effectively ignores the
429
+ authentication in the spec for a single request.
430
+ :type _request_auth: dict, optional
431
+ :param _content_type: force content-type for the request.
432
+ :type _content_type: str, Optional
433
+ :param _headers: set to override the headers for a single
434
+ request; this effectively ignores the headers
435
+ in the spec for a single request.
436
+ :type _headers: dict, optional
437
+ :param _host_index: set to override the host_index for a single
438
+ request; this effectively ignores the host_index
439
+ in the spec for a single request.
440
+ :type _host_index: int, optional
441
+ :return: Returns the result object.
442
+ """ # noqa: E501
443
+
444
+ _param = self._evaluate_serialize(
445
+ _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index
446
+ )
447
+
448
+ _response_types_map: Dict[str, Optional[str]] = {
449
+ "201": None,
450
+ "500": None,
451
+ }
452
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
453
+ return response_data.response
454
+
455
+ def _evaluate_serialize(
456
+ self,
457
+ _request_auth,
458
+ _content_type,
459
+ _headers,
460
+ _host_index,
461
+ ) -> RequestSerialized:
462
+ _host = None
463
+
464
+ _collection_formats: Dict[str, str] = {}
465
+
466
+ _path_params: Dict[str, str] = {}
467
+ _query_params: List[Tuple[str, str]] = []
468
+ _header_params: Dict[str, Optional[str]] = _headers or {}
469
+ _form_params: List[Tuple[str, str]] = []
470
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
471
+ _body_params: Optional[bytes] = None
472
+
473
+ # process the path parameters
474
+ # process the query parameters
475
+ # process the header parameters
476
+ # process the form parameters
477
+ # process the body parameter
478
+
479
+ # authentication setting
480
+ _auth_settings: List[str] = []
481
+
482
+ return self.api_client.param_serialize(
483
+ method="POST",
484
+ resource_path="/evaluate",
485
+ path_params=_path_params,
486
+ query_params=_query_params,
487
+ header_params=_header_params,
488
+ body=_body_params,
489
+ post_params=_form_params,
490
+ files=_files,
491
+ auth_settings=_auth_settings,
492
+ collection_formats=_collection_formats,
493
+ _host=_host,
494
+ _request_auth=_request_auth,
495
+ )
496
+
497
+ @validate_call
498
+ def remove_information_piece(
499
+ self,
500
+ delete_request: DeleteRequest,
501
+ _request_timeout: Union[
502
+ None,
503
+ Annotated[StrictFloat, Field(gt=0)],
504
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
505
+ ] = None,
506
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
507
+ _content_type: Optional[StrictStr] = None,
508
+ _headers: Optional[Dict[StrictStr, Any]] = None,
509
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
510
+ ) -> None:
511
+ """remove information piece
512
+
513
+
514
+ :param delete_request: (required)
515
+ :type delete_request: DeleteRequest
516
+ :param _request_timeout: timeout setting for this request. If one
517
+ number provided, it will be total request
518
+ timeout. It can also be a pair (tuple) of
519
+ (connection, read) timeouts.
520
+ :type _request_timeout: int, tuple(int, int), optional
521
+ :param _request_auth: set to override the auth_settings for an a single
522
+ request; this effectively ignores the
523
+ authentication in the spec for a single request.
524
+ :type _request_auth: dict, optional
525
+ :param _content_type: force content-type for the request.
526
+ :type _content_type: str, Optional
527
+ :param _headers: set to override the headers for a single
528
+ request; this effectively ignores the headers
529
+ in the spec for a single request.
530
+ :type _headers: dict, optional
531
+ :param _host_index: set to override the host_index for a single
532
+ request; this effectively ignores the host_index
533
+ in the spec for a single request.
534
+ :type _host_index: int, optional
535
+ :return: Returns the result object.
536
+ """ # noqa: E501
537
+
538
+ _param = self._remove_information_piece_serialize(
539
+ delete_request=delete_request,
540
+ _request_auth=_request_auth,
541
+ _content_type=_content_type,
542
+ _headers=_headers,
543
+ _host_index=_host_index,
544
+ )
545
+
546
+ _response_types_map: Dict[str, Optional[str]] = {
547
+ "202": None,
548
+ "404": None,
549
+ "422": None,
550
+ "500": None,
551
+ }
552
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
553
+ response_data.read()
554
+ return self.api_client.response_deserialize(
555
+ response_data=response_data,
556
+ response_types_map=_response_types_map,
557
+ ).data
558
+
559
+ @validate_call
560
+ def remove_information_piece_with_http_info(
561
+ self,
562
+ delete_request: DeleteRequest,
563
+ _request_timeout: Union[
564
+ None,
565
+ Annotated[StrictFloat, Field(gt=0)],
566
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
567
+ ] = None,
568
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
569
+ _content_type: Optional[StrictStr] = None,
570
+ _headers: Optional[Dict[StrictStr, Any]] = None,
571
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
572
+ ) -> ApiResponse[None]:
573
+ """remove information piece
574
+
575
+
576
+ :param delete_request: (required)
577
+ :type delete_request: DeleteRequest
578
+ :param _request_timeout: timeout setting for this request. If one
579
+ number provided, it will be total request
580
+ timeout. It can also be a pair (tuple) of
581
+ (connection, read) timeouts.
582
+ :type _request_timeout: int, tuple(int, int), optional
583
+ :param _request_auth: set to override the auth_settings for an a single
584
+ request; this effectively ignores the
585
+ authentication in the spec for a single request.
586
+ :type _request_auth: dict, optional
587
+ :param _content_type: force content-type for the request.
588
+ :type _content_type: str, Optional
589
+ :param _headers: set to override the headers for a single
590
+ request; this effectively ignores the headers
591
+ in the spec for a single request.
592
+ :type _headers: dict, optional
593
+ :param _host_index: set to override the host_index for a single
594
+ request; this effectively ignores the host_index
595
+ in the spec for a single request.
596
+ :type _host_index: int, optional
597
+ :return: Returns the result object.
598
+ """ # noqa: E501
599
+
600
+ _param = self._remove_information_piece_serialize(
601
+ delete_request=delete_request,
602
+ _request_auth=_request_auth,
603
+ _content_type=_content_type,
604
+ _headers=_headers,
605
+ _host_index=_host_index,
606
+ )
607
+
608
+ _response_types_map: Dict[str, Optional[str]] = {
609
+ "202": None,
610
+ "404": None,
611
+ "422": None,
612
+ "500": None,
613
+ }
614
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
615
+ response_data.read()
616
+ return self.api_client.response_deserialize(
617
+ response_data=response_data,
618
+ response_types_map=_response_types_map,
619
+ )
620
+
621
+ @validate_call
622
+ def remove_information_piece_without_preload_content(
623
+ self,
624
+ delete_request: DeleteRequest,
625
+ _request_timeout: Union[
626
+ None,
627
+ Annotated[StrictFloat, Field(gt=0)],
628
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
629
+ ] = None,
630
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
631
+ _content_type: Optional[StrictStr] = None,
632
+ _headers: Optional[Dict[StrictStr, Any]] = None,
633
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
634
+ ) -> RESTResponseType:
635
+ """remove information piece
636
+
637
+
638
+ :param delete_request: (required)
639
+ :type delete_request: DeleteRequest
640
+ :param _request_timeout: timeout setting for this request. If one
641
+ number provided, it will be total request
642
+ timeout. It can also be a pair (tuple) of
643
+ (connection, read) timeouts.
644
+ :type _request_timeout: int, tuple(int, int), optional
645
+ :param _request_auth: set to override the auth_settings for an a single
646
+ request; this effectively ignores the
647
+ authentication in the spec for a single request.
648
+ :type _request_auth: dict, optional
649
+ :param _content_type: force content-type for the request.
650
+ :type _content_type: str, Optional
651
+ :param _headers: set to override the headers for a single
652
+ request; this effectively ignores the headers
653
+ in the spec for a single request.
654
+ :type _headers: dict, optional
655
+ :param _host_index: set to override the host_index for a single
656
+ request; this effectively ignores the host_index
657
+ in the spec for a single request.
658
+ :type _host_index: int, optional
659
+ :return: Returns the result object.
660
+ """ # noqa: E501
661
+
662
+ _param = self._remove_information_piece_serialize(
663
+ delete_request=delete_request,
664
+ _request_auth=_request_auth,
665
+ _content_type=_content_type,
666
+ _headers=_headers,
667
+ _host_index=_host_index,
668
+ )
669
+
670
+ _response_types_map: Dict[str, Optional[str]] = {
671
+ "202": None,
672
+ "404": None,
673
+ "422": None,
674
+ "500": None,
675
+ }
676
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
677
+ return response_data.response
678
+
679
+ def _remove_information_piece_serialize(
680
+ self,
681
+ delete_request,
682
+ _request_auth,
683
+ _content_type,
684
+ _headers,
685
+ _host_index,
686
+ ) -> RequestSerialized:
687
+ _host = None
688
+
689
+ _collection_formats: Dict[str, str] = {}
690
+
691
+ _path_params: Dict[str, str] = {}
692
+ _query_params: List[Tuple[str, str]] = []
693
+ _header_params: Dict[str, Optional[str]] = _headers or {}
694
+ _form_params: List[Tuple[str, str]] = []
695
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
696
+ _body_params: Optional[bytes] = None
697
+
698
+ # process the path parameters
699
+ # process the query parameters
700
+ # process the header parameters
701
+ # process the form parameters
702
+ # process the body parameter
703
+ if delete_request is not None:
704
+ _body_params = delete_request
705
+
706
+ # set the HTTP header `Content-Type`
707
+ if _content_type:
708
+ _header_params["Content-Type"] = _content_type
709
+ else:
710
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
711
+ if _default_content_type is not None:
712
+ _header_params["Content-Type"] = _default_content_type
713
+
714
+ # authentication setting
715
+ _auth_settings: List[str] = []
716
+
717
+ return self.api_client.param_serialize(
718
+ method="POST",
719
+ resource_path="/information_pieces/remove",
720
+ path_params=_path_params,
721
+ query_params=_query_params,
722
+ header_params=_header_params,
723
+ body=_body_params,
724
+ post_params=_form_params,
725
+ files=_files,
726
+ auth_settings=_auth_settings,
727
+ collection_formats=_collection_formats,
728
+ _host=_host,
729
+ _request_auth=_request_auth,
730
+ )
731
+
732
+ @validate_call
733
+ def upload_information_piece(
734
+ self,
735
+ information_piece: List[InformationPiece],
736
+ _request_timeout: Union[
737
+ None,
738
+ Annotated[StrictFloat, Field(gt=0)],
739
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
740
+ ] = None,
741
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
742
+ _content_type: Optional[StrictStr] = None,
743
+ _headers: Optional[Dict[StrictStr, Any]] = None,
744
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
745
+ ) -> None:
746
+ """Upload information pieces for vectordatabase
747
+
748
+
749
+ :param information_piece: (required)
750
+ :type information_piece: List[InformationPiece]
751
+ :param _request_timeout: timeout setting for this request. If one
752
+ number provided, it will be total request
753
+ timeout. It can also be a pair (tuple) of
754
+ (connection, read) timeouts.
755
+ :type _request_timeout: int, tuple(int, int), optional
756
+ :param _request_auth: set to override the auth_settings for an a single
757
+ request; this effectively ignores the
758
+ authentication in the spec for a single request.
759
+ :type _request_auth: dict, optional
760
+ :param _content_type: force content-type for the request.
761
+ :type _content_type: str, Optional
762
+ :param _headers: set to override the headers for a single
763
+ request; this effectively ignores the headers
764
+ in the spec for a single request.
765
+ :type _headers: dict, optional
766
+ :param _host_index: set to override the host_index for a single
767
+ request; this effectively ignores the host_index
768
+ in the spec for a single request.
769
+ :type _host_index: int, optional
770
+ :return: Returns the result object.
771
+ """ # noqa: E501
772
+
773
+ _param = self._upload_information_piece_serialize(
774
+ information_piece=information_piece,
775
+ _request_auth=_request_auth,
776
+ _content_type=_content_type,
777
+ _headers=_headers,
778
+ _host_index=_host_index,
779
+ )
780
+
781
+ _response_types_map: Dict[str, Optional[str]] = {
782
+ "201": None,
783
+ "422": "str",
784
+ "500": "str",
785
+ }
786
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
787
+ response_data.read()
788
+ return self.api_client.response_deserialize(
789
+ response_data=response_data,
790
+ response_types_map=_response_types_map,
791
+ ).data
792
+
793
+ @validate_call
794
+ def upload_information_piece_with_http_info(
795
+ self,
796
+ information_piece: List[InformationPiece],
797
+ _request_timeout: Union[
798
+ None,
799
+ Annotated[StrictFloat, Field(gt=0)],
800
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
801
+ ] = None,
802
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
803
+ _content_type: Optional[StrictStr] = None,
804
+ _headers: Optional[Dict[StrictStr, Any]] = None,
805
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
806
+ ) -> ApiResponse[None]:
807
+ """Upload information pieces for vectordatabase
808
+
809
+
810
+ :param information_piece: (required)
811
+ :type information_piece: List[InformationPiece]
812
+ :param _request_timeout: timeout setting for this request. If one
813
+ number provided, it will be total request
814
+ timeout. It can also be a pair (tuple) of
815
+ (connection, read) timeouts.
816
+ :type _request_timeout: int, tuple(int, int), optional
817
+ :param _request_auth: set to override the auth_settings for an a single
818
+ request; this effectively ignores the
819
+ authentication in the spec for a single request.
820
+ :type _request_auth: dict, optional
821
+ :param _content_type: force content-type for the request.
822
+ :type _content_type: str, Optional
823
+ :param _headers: set to override the headers for a single
824
+ request; this effectively ignores the headers
825
+ in the spec for a single request.
826
+ :type _headers: dict, optional
827
+ :param _host_index: set to override the host_index for a single
828
+ request; this effectively ignores the host_index
829
+ in the spec for a single request.
830
+ :type _host_index: int, optional
831
+ :return: Returns the result object.
832
+ """ # noqa: E501
833
+
834
+ _param = self._upload_information_piece_serialize(
835
+ information_piece=information_piece,
836
+ _request_auth=_request_auth,
837
+ _content_type=_content_type,
838
+ _headers=_headers,
839
+ _host_index=_host_index,
840
+ )
841
+
842
+ _response_types_map: Dict[str, Optional[str]] = {
843
+ "201": None,
844
+ "422": "str",
845
+ "500": "str",
846
+ }
847
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
848
+ response_data.read()
849
+ return self.api_client.response_deserialize(
850
+ response_data=response_data,
851
+ response_types_map=_response_types_map,
852
+ )
853
+
854
+ @validate_call
855
+ def upload_information_piece_without_preload_content(
856
+ self,
857
+ information_piece: List[InformationPiece],
858
+ _request_timeout: Union[
859
+ None,
860
+ Annotated[StrictFloat, Field(gt=0)],
861
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
862
+ ] = None,
863
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
864
+ _content_type: Optional[StrictStr] = None,
865
+ _headers: Optional[Dict[StrictStr, Any]] = None,
866
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
867
+ ) -> RESTResponseType:
868
+ """Upload information pieces for vectordatabase
869
+
870
+
871
+ :param information_piece: (required)
872
+ :type information_piece: List[InformationPiece]
873
+ :param _request_timeout: timeout setting for this request. If one
874
+ number provided, it will be total request
875
+ timeout. It can also be a pair (tuple) of
876
+ (connection, read) timeouts.
877
+ :type _request_timeout: int, tuple(int, int), optional
878
+ :param _request_auth: set to override the auth_settings for an a single
879
+ request; this effectively ignores the
880
+ authentication in the spec for a single request.
881
+ :type _request_auth: dict, optional
882
+ :param _content_type: force content-type for the request.
883
+ :type _content_type: str, Optional
884
+ :param _headers: set to override the headers for a single
885
+ request; this effectively ignores the headers
886
+ in the spec for a single request.
887
+ :type _headers: dict, optional
888
+ :param _host_index: set to override the host_index for a single
889
+ request; this effectively ignores the host_index
890
+ in the spec for a single request.
891
+ :type _host_index: int, optional
892
+ :return: Returns the result object.
893
+ """ # noqa: E501
894
+
895
+ _param = self._upload_information_piece_serialize(
896
+ information_piece=information_piece,
897
+ _request_auth=_request_auth,
898
+ _content_type=_content_type,
899
+ _headers=_headers,
900
+ _host_index=_host_index,
901
+ )
902
+
903
+ _response_types_map: Dict[str, Optional[str]] = {
904
+ "201": None,
905
+ "422": "str",
906
+ "500": "str",
907
+ }
908
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
909
+ return response_data.response
910
+
911
+ def _upload_information_piece_serialize(
912
+ self,
913
+ information_piece,
914
+ _request_auth,
915
+ _content_type,
916
+ _headers,
917
+ _host_index,
918
+ ) -> RequestSerialized:
919
+ _host = None
920
+
921
+ _collection_formats: Dict[str, str] = {
922
+ "InformationPiece": "",
923
+ }
924
+
925
+ _path_params: Dict[str, str] = {}
926
+ _query_params: List[Tuple[str, str]] = []
927
+ _header_params: Dict[str, Optional[str]] = _headers or {}
928
+ _form_params: List[Tuple[str, str]] = []
929
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
930
+ _body_params: Optional[bytes] = None
931
+
932
+ # process the path parameters
933
+ # process the query parameters
934
+ # process the header parameters
935
+ # process the form parameters
936
+ # process the body parameter
937
+ if information_piece is not None:
938
+ _body_params = information_piece
939
+
940
+ # set the HTTP header `Accept`
941
+ if "Accept" not in _header_params:
942
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
943
+
944
+ # set the HTTP header `Content-Type`
945
+ if _content_type:
946
+ _header_params["Content-Type"] = _content_type
947
+ else:
948
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
949
+ if _default_content_type is not None:
950
+ _header_params["Content-Type"] = _default_content_type
951
+
952
+ # authentication setting
953
+ _auth_settings: List[str] = []
954
+
955
+ return self.api_client.param_serialize(
956
+ method="POST",
957
+ resource_path="/information_pieces/upload",
958
+ path_params=_path_params,
959
+ query_params=_query_params,
960
+ header_params=_header_params,
961
+ body=_body_params,
962
+ post_params=_form_params,
963
+ files=_files,
964
+ auth_settings=_auth_settings,
965
+ collection_formats=_collection_formats,
966
+ _host=_host,
967
+ _request_auth=_request_auth,
968
+ )