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,516 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ extractor-api-lib
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
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 pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from typing import List
20
+ from admin_api_lib.extractor_api_client.openapi_client.models.extraction_parameters import ExtractionParameters
21
+ from admin_api_lib.extractor_api_client.openapi_client.models.extraction_request import ExtractionRequest
22
+ from admin_api_lib.extractor_api_client.openapi_client.models.information_piece import InformationPiece
23
+
24
+ from admin_api_lib.extractor_api_client.openapi_client.api_client import ApiClient, RequestSerialized
25
+ from admin_api_lib.extractor_api_client.openapi_client.api_response import ApiResponse
26
+ from admin_api_lib.extractor_api_client.openapi_client.rest import RESTResponseType
27
+
28
+
29
+ class ExtractorApi:
30
+ """NOTE: This class is auto generated by OpenAPI Generator
31
+ Ref: https://openapi-generator.tech
32
+
33
+ Do not edit the class manually.
34
+ """
35
+
36
+ def __init__(self, api_client=None) -> None:
37
+ if api_client is None:
38
+ api_client = ApiClient.get_default()
39
+ self.api_client = api_client
40
+
41
+ @validate_call
42
+ def extract_from_file_post(
43
+ self,
44
+ extraction_request: ExtractionRequest,
45
+ _request_timeout: Union[
46
+ None,
47
+ Annotated[StrictFloat, Field(gt=0)],
48
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
49
+ ] = None,
50
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
51
+ _content_type: Optional[StrictStr] = None,
52
+ _headers: Optional[Dict[StrictStr, Any]] = None,
53
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
54
+ ) -> List[InformationPiece]:
55
+ """extract_from_file_post
56
+
57
+
58
+ :param extraction_request: (required)
59
+ :type extraction_request: ExtractionRequest
60
+ :param _request_timeout: timeout setting for this request. If one
61
+ number provided, it will be total request
62
+ timeout. It can also be a pair (tuple) of
63
+ (connection, read) timeouts.
64
+ :type _request_timeout: int, tuple(int, int), optional
65
+ :param _request_auth: set to override the auth_settings for an a single
66
+ request; this effectively ignores the
67
+ authentication in the spec for a single request.
68
+ :type _request_auth: dict, optional
69
+ :param _content_type: force content-type for the request.
70
+ :type _content_type: str, Optional
71
+ :param _headers: set to override the headers for a single
72
+ request; this effectively ignores the headers
73
+ in the spec for a single request.
74
+ :type _headers: dict, optional
75
+ :param _host_index: set to override the host_index for a single
76
+ request; this effectively ignores the host_index
77
+ in the spec for a single request.
78
+ :type _host_index: int, optional
79
+ :return: Returns the result object.
80
+ """ # noqa: E501
81
+
82
+ _param = self._extract_from_file_post_serialize(
83
+ extraction_request=extraction_request,
84
+ _request_auth=_request_auth,
85
+ _content_type=_content_type,
86
+ _headers=_headers,
87
+ _host_index=_host_index,
88
+ )
89
+
90
+ _response_types_map: Dict[str, Optional[str]] = {
91
+ "200": "List[InformationPiece]",
92
+ "422": None,
93
+ "500": None,
94
+ }
95
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
96
+ response_data.read()
97
+ return self.api_client.response_deserialize(
98
+ response_data=response_data,
99
+ response_types_map=_response_types_map,
100
+ ).data
101
+
102
+ @validate_call
103
+ def extract_from_file_post_with_http_info(
104
+ self,
105
+ extraction_request: ExtractionRequest,
106
+ _request_timeout: Union[
107
+ None,
108
+ Annotated[StrictFloat, Field(gt=0)],
109
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
110
+ ] = None,
111
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
112
+ _content_type: Optional[StrictStr] = None,
113
+ _headers: Optional[Dict[StrictStr, Any]] = None,
114
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
115
+ ) -> ApiResponse[List[InformationPiece]]:
116
+ """extract_from_file_post
117
+
118
+
119
+ :param extraction_request: (required)
120
+ :type extraction_request: ExtractionRequest
121
+ :param _request_timeout: timeout setting for this request. If one
122
+ number provided, it will be total request
123
+ timeout. It can also be a pair (tuple) of
124
+ (connection, read) timeouts.
125
+ :type _request_timeout: int, tuple(int, int), optional
126
+ :param _request_auth: set to override the auth_settings for an a single
127
+ request; this effectively ignores the
128
+ authentication in the spec for a single request.
129
+ :type _request_auth: dict, optional
130
+ :param _content_type: force content-type for the request.
131
+ :type _content_type: str, Optional
132
+ :param _headers: set to override the headers for a single
133
+ request; this effectively ignores the headers
134
+ in the spec for a single request.
135
+ :type _headers: dict, optional
136
+ :param _host_index: set to override the host_index for a single
137
+ request; this effectively ignores the host_index
138
+ in the spec for a single request.
139
+ :type _host_index: int, optional
140
+ :return: Returns the result object.
141
+ """ # noqa: E501
142
+
143
+ _param = self._extract_from_file_post_serialize(
144
+ extraction_request=extraction_request,
145
+ _request_auth=_request_auth,
146
+ _content_type=_content_type,
147
+ _headers=_headers,
148
+ _host_index=_host_index,
149
+ )
150
+
151
+ _response_types_map: Dict[str, Optional[str]] = {
152
+ "200": "List[InformationPiece]",
153
+ "422": None,
154
+ "500": None,
155
+ }
156
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
157
+ response_data.read()
158
+ return self.api_client.response_deserialize(
159
+ response_data=response_data,
160
+ response_types_map=_response_types_map,
161
+ )
162
+
163
+ @validate_call
164
+ def extract_from_file_post_without_preload_content(
165
+ self,
166
+ extraction_request: ExtractionRequest,
167
+ _request_timeout: Union[
168
+ None,
169
+ Annotated[StrictFloat, Field(gt=0)],
170
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
171
+ ] = None,
172
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
173
+ _content_type: Optional[StrictStr] = None,
174
+ _headers: Optional[Dict[StrictStr, Any]] = None,
175
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
176
+ ) -> RESTResponseType:
177
+ """extract_from_file_post
178
+
179
+
180
+ :param extraction_request: (required)
181
+ :type extraction_request: ExtractionRequest
182
+ :param _request_timeout: timeout setting for this request. If one
183
+ number provided, it will be total request
184
+ timeout. It can also be a pair (tuple) of
185
+ (connection, read) timeouts.
186
+ :type _request_timeout: int, tuple(int, int), optional
187
+ :param _request_auth: set to override the auth_settings for an a single
188
+ request; this effectively ignores the
189
+ authentication in the spec for a single request.
190
+ :type _request_auth: dict, optional
191
+ :param _content_type: force content-type for the request.
192
+ :type _content_type: str, Optional
193
+ :param _headers: set to override the headers for a single
194
+ request; this effectively ignores the headers
195
+ in the spec for a single request.
196
+ :type _headers: dict, optional
197
+ :param _host_index: set to override the host_index for a single
198
+ request; this effectively ignores the host_index
199
+ in the spec for a single request.
200
+ :type _host_index: int, optional
201
+ :return: Returns the result object.
202
+ """ # noqa: E501
203
+
204
+ _param = self._extract_from_file_post_serialize(
205
+ extraction_request=extraction_request,
206
+ _request_auth=_request_auth,
207
+ _content_type=_content_type,
208
+ _headers=_headers,
209
+ _host_index=_host_index,
210
+ )
211
+
212
+ _response_types_map: Dict[str, Optional[str]] = {
213
+ "200": "List[InformationPiece]",
214
+ "422": None,
215
+ "500": None,
216
+ }
217
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
218
+ return response_data.response
219
+
220
+ def _extract_from_file_post_serialize(
221
+ self,
222
+ extraction_request,
223
+ _request_auth,
224
+ _content_type,
225
+ _headers,
226
+ _host_index,
227
+ ) -> RequestSerialized:
228
+
229
+ _host = None
230
+
231
+ _collection_formats: Dict[str, str] = {}
232
+
233
+ _path_params: Dict[str, str] = {}
234
+ _query_params: List[Tuple[str, str]] = []
235
+ _header_params: Dict[str, Optional[str]] = _headers or {}
236
+ _form_params: List[Tuple[str, str]] = []
237
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
238
+ _body_params: Optional[bytes] = None
239
+
240
+ # process the path parameters
241
+ # process the query parameters
242
+ # process the header parameters
243
+ # process the form parameters
244
+ # process the body parameter
245
+ if extraction_request is not None:
246
+ _body_params = extraction_request
247
+
248
+ # set the HTTP header `Accept`
249
+ if "Accept" not in _header_params:
250
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
251
+
252
+ # set the HTTP header `Content-Type`
253
+ if _content_type:
254
+ _header_params["Content-Type"] = _content_type
255
+ else:
256
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
257
+ if _default_content_type is not None:
258
+ _header_params["Content-Type"] = _default_content_type
259
+
260
+ # authentication setting
261
+ _auth_settings: List[str] = []
262
+
263
+ return self.api_client.param_serialize(
264
+ method="POST",
265
+ resource_path="/extract_from_file",
266
+ path_params=_path_params,
267
+ query_params=_query_params,
268
+ header_params=_header_params,
269
+ body=_body_params,
270
+ post_params=_form_params,
271
+ files=_files,
272
+ auth_settings=_auth_settings,
273
+ collection_formats=_collection_formats,
274
+ _host=_host,
275
+ _request_auth=_request_auth,
276
+ )
277
+
278
+ @validate_call
279
+ def extract_from_source(
280
+ self,
281
+ extraction_parameters: ExtractionParameters,
282
+ _request_timeout: Union[
283
+ None,
284
+ Annotated[StrictFloat, Field(gt=0)],
285
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
286
+ ] = None,
287
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
288
+ _content_type: Optional[StrictStr] = None,
289
+ _headers: Optional[Dict[StrictStr, Any]] = None,
290
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
291
+ ) -> List[InformationPiece]:
292
+ """extract_from_source
293
+
294
+
295
+ :param extraction_parameters: (required)
296
+ :type extraction_parameters: ExtractionParameters
297
+ :param _request_timeout: timeout setting for this request. If one
298
+ number provided, it will be total request
299
+ timeout. It can also be a pair (tuple) of
300
+ (connection, read) timeouts.
301
+ :type _request_timeout: int, tuple(int, int), optional
302
+ :param _request_auth: set to override the auth_settings for an a single
303
+ request; this effectively ignores the
304
+ authentication in the spec for a single request.
305
+ :type _request_auth: dict, optional
306
+ :param _content_type: force content-type for the request.
307
+ :type _content_type: str, Optional
308
+ :param _headers: set to override the headers for a single
309
+ request; this effectively ignores the headers
310
+ in the spec for a single request.
311
+ :type _headers: dict, optional
312
+ :param _host_index: set to override the host_index for a single
313
+ request; this effectively ignores the host_index
314
+ in the spec for a single request.
315
+ :type _host_index: int, optional
316
+ :return: Returns the result object.
317
+ """ # noqa: E501
318
+
319
+ _param = self._extract_from_source_serialize(
320
+ extraction_parameters=extraction_parameters,
321
+ _request_auth=_request_auth,
322
+ _content_type=_content_type,
323
+ _headers=_headers,
324
+ _host_index=_host_index,
325
+ )
326
+
327
+ _response_types_map: Dict[str, Optional[str]] = {
328
+ "200": "List[InformationPiece]",
329
+ "404": None,
330
+ "422": None,
331
+ "500": None,
332
+ }
333
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
334
+ response_data.read()
335
+ return self.api_client.response_deserialize(
336
+ response_data=response_data,
337
+ response_types_map=_response_types_map,
338
+ ).data
339
+
340
+ @validate_call
341
+ def extract_from_source_with_http_info(
342
+ self,
343
+ extraction_parameters: ExtractionParameters,
344
+ _request_timeout: Union[
345
+ None,
346
+ Annotated[StrictFloat, Field(gt=0)],
347
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
348
+ ] = None,
349
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
350
+ _content_type: Optional[StrictStr] = None,
351
+ _headers: Optional[Dict[StrictStr, Any]] = None,
352
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
353
+ ) -> ApiResponse[List[InformationPiece]]:
354
+ """extract_from_source
355
+
356
+
357
+ :param extraction_parameters: (required)
358
+ :type extraction_parameters: ExtractionParameters
359
+ :param _request_timeout: timeout setting for this request. If one
360
+ number provided, it will be total request
361
+ timeout. It can also be a pair (tuple) of
362
+ (connection, read) timeouts.
363
+ :type _request_timeout: int, tuple(int, int), optional
364
+ :param _request_auth: set to override the auth_settings for an a single
365
+ request; this effectively ignores the
366
+ authentication in the spec for a single request.
367
+ :type _request_auth: dict, optional
368
+ :param _content_type: force content-type for the request.
369
+ :type _content_type: str, Optional
370
+ :param _headers: set to override the headers for a single
371
+ request; this effectively ignores the headers
372
+ in the spec for a single request.
373
+ :type _headers: dict, optional
374
+ :param _host_index: set to override the host_index for a single
375
+ request; this effectively ignores the host_index
376
+ in the spec for a single request.
377
+ :type _host_index: int, optional
378
+ :return: Returns the result object.
379
+ """ # noqa: E501
380
+
381
+ _param = self._extract_from_source_serialize(
382
+ extraction_parameters=extraction_parameters,
383
+ _request_auth=_request_auth,
384
+ _content_type=_content_type,
385
+ _headers=_headers,
386
+ _host_index=_host_index,
387
+ )
388
+
389
+ _response_types_map: Dict[str, Optional[str]] = {
390
+ "200": "List[InformationPiece]",
391
+ "404": None,
392
+ "422": None,
393
+ "500": None,
394
+ }
395
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
396
+ response_data.read()
397
+ return self.api_client.response_deserialize(
398
+ response_data=response_data,
399
+ response_types_map=_response_types_map,
400
+ )
401
+
402
+ @validate_call
403
+ def extract_from_source_without_preload_content(
404
+ self,
405
+ extraction_parameters: ExtractionParameters,
406
+ _request_timeout: Union[
407
+ None,
408
+ Annotated[StrictFloat, Field(gt=0)],
409
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
410
+ ] = None,
411
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
412
+ _content_type: Optional[StrictStr] = None,
413
+ _headers: Optional[Dict[StrictStr, Any]] = None,
414
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
415
+ ) -> RESTResponseType:
416
+ """extract_from_source
417
+
418
+
419
+ :param extraction_parameters: (required)
420
+ :type extraction_parameters: ExtractionParameters
421
+ :param _request_timeout: timeout setting for this request. If one
422
+ number provided, it will be total request
423
+ timeout. It can also be a pair (tuple) of
424
+ (connection, read) timeouts.
425
+ :type _request_timeout: int, tuple(int, int), optional
426
+ :param _request_auth: set to override the auth_settings for an a single
427
+ request; this effectively ignores the
428
+ authentication in the spec for a single request.
429
+ :type _request_auth: dict, optional
430
+ :param _content_type: force content-type for the request.
431
+ :type _content_type: str, Optional
432
+ :param _headers: set to override the headers for a single
433
+ request; this effectively ignores the headers
434
+ in the spec for a single request.
435
+ :type _headers: dict, optional
436
+ :param _host_index: set to override the host_index for a single
437
+ request; this effectively ignores the host_index
438
+ in the spec for a single request.
439
+ :type _host_index: int, optional
440
+ :return: Returns the result object.
441
+ """ # noqa: E501
442
+
443
+ _param = self._extract_from_source_serialize(
444
+ extraction_parameters=extraction_parameters,
445
+ _request_auth=_request_auth,
446
+ _content_type=_content_type,
447
+ _headers=_headers,
448
+ _host_index=_host_index,
449
+ )
450
+
451
+ _response_types_map: Dict[str, Optional[str]] = {
452
+ "200": "List[InformationPiece]",
453
+ "404": None,
454
+ "422": None,
455
+ "500": None,
456
+ }
457
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
458
+ return response_data.response
459
+
460
+ def _extract_from_source_serialize(
461
+ self,
462
+ extraction_parameters,
463
+ _request_auth,
464
+ _content_type,
465
+ _headers,
466
+ _host_index,
467
+ ) -> RequestSerialized:
468
+
469
+ _host = None
470
+
471
+ _collection_formats: Dict[str, str] = {}
472
+
473
+ _path_params: Dict[str, str] = {}
474
+ _query_params: List[Tuple[str, str]] = []
475
+ _header_params: Dict[str, Optional[str]] = _headers or {}
476
+ _form_params: List[Tuple[str, str]] = []
477
+ _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
478
+ _body_params: Optional[bytes] = None
479
+
480
+ # process the path parameters
481
+ # process the query parameters
482
+ # process the header parameters
483
+ # process the form parameters
484
+ # process the body parameter
485
+ if extraction_parameters is not None:
486
+ _body_params = extraction_parameters
487
+
488
+ # set the HTTP header `Accept`
489
+ if "Accept" not in _header_params:
490
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
491
+
492
+ # set the HTTP header `Content-Type`
493
+ if _content_type:
494
+ _header_params["Content-Type"] = _content_type
495
+ else:
496
+ _default_content_type = self.api_client.select_header_content_type(["application/json"])
497
+ if _default_content_type is not None:
498
+ _header_params["Content-Type"] = _default_content_type
499
+
500
+ # authentication setting
501
+ _auth_settings: List[str] = []
502
+
503
+ return self.api_client.param_serialize(
504
+ method="POST",
505
+ resource_path="/extract_from_source",
506
+ path_params=_path_params,
507
+ query_params=_query_params,
508
+ header_params=_header_params,
509
+ body=_body_params,
510
+ post_params=_form_params,
511
+ files=_files,
512
+ auth_settings=_auth_settings,
513
+ collection_formats=_collection_formats,
514
+ _host=_host,
515
+ _request_auth=_request_auth,
516
+ )