qanswer_sdk 3.1509.0__py3-none-any.whl → 3.1510.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 (126) hide show
  1. qanswer_sdk/__init__.py +31 -24
  2. qanswer_sdk/api/__init__.py +0 -1
  3. qanswer_sdk/api/admin_api.py +914 -142
  4. qanswer_sdk/api/ai_assistant_access_rights_api.py +883 -280
  5. qanswer_sdk/api/ai_assistant_api.py +289 -61
  6. qanswer_sdk/api/branding_api.py +6 -6
  7. qanswer_sdk/api/connector_website_api.py +287 -0
  8. qanswer_sdk/api/connectors_api.py +863 -11
  9. qanswer_sdk/api/connectors_data_api.py +28 -27
  10. qanswer_sdk/api/mcp_api.py +1103 -469
  11. qanswer_sdk/api/payment_api.py +3 -3
  12. qanswer_sdk/api/socket_api.py +0 -245
  13. qanswer_sdk/api/task_ai_excel_api.py +288 -0
  14. qanswer_sdk/api/task_report_copilot_api.py +49 -122
  15. qanswer_sdk/api/tool_embedder_api.py +552 -1
  16. qanswer_sdk/api/tool_llm_api.py +1059 -10
  17. qanswer_sdk/api/unit_organizations_api.py +1240 -165
  18. qanswer_sdk/api/unit_user_api.py +506 -0
  19. qanswer_sdk/api_client.py +1 -1
  20. qanswer_sdk/configuration.py +1 -1
  21. qanswer_sdk/models/__init__.py +30 -22
  22. qanswer_sdk/models/access_pdf_payload_model.py +6 -4
  23. qanswer_sdk/models/add_qn_a_request.py +5 -3
  24. qanswer_sdk/models/{assistant_template.py → ai_assistant_clone_response.py} +9 -19
  25. qanswer_sdk/models/ai_assistant_dto.py +4 -2
  26. qanswer_sdk/models/ai_assistant_filter_dto.py +3 -1
  27. qanswer_sdk/models/{user_dataset_access_control_origin_header.py → ai_assistant_restricted_domain.py} +8 -8
  28. qanswer_sdk/models/ai_assistant_share_response.py +93 -0
  29. qanswer_sdk/models/api_key_mcp_authentication_config.py +2 -2
  30. qanswer_sdk/models/assistant_template_filter_dto.py +93 -0
  31. qanswer_sdk/models/{relation_extraction_schema.py → assistant_template_with_tools_selection_dto.py} +26 -24
  32. qanswer_sdk/models/audio_file_upload_payload.py +4 -2
  33. qanswer_sdk/models/auto_bot_description_request.py +5 -3
  34. qanswer_sdk/models/chatbot_chat_payload.py +6 -2
  35. qanswer_sdk/models/connector_type_dto.py +101 -0
  36. qanswer_sdk/models/{relation_extraction_data_input.py → connector_type_list_dto.py} +14 -14
  37. qanswer_sdk/models/conversation_message.py +37 -7
  38. qanswer_sdk/models/conversation_model.py +8 -2
  39. qanswer_sdk/models/credits_info_global_dto.py +95 -0
  40. qanswer_sdk/models/credits_info_organization_dto.py +93 -0
  41. qanswer_sdk/models/dataset_detail_kg.py +30 -10
  42. qanswer_sdk/models/dataset_schema.py +5 -1
  43. qanswer_sdk/models/dataset_update_object.py +8 -2
  44. qanswer_sdk/models/document_content_update_model.py +4 -2
  45. qanswer_sdk/models/econsilium_search_index_add_payload.py +3 -1
  46. qanswer_sdk/models/embedder_create_dto.py +9 -3
  47. qanswer_sdk/models/embedder_detailed_dto.py +9 -3
  48. qanswer_sdk/models/embedder_update_dto.py +9 -3
  49. qanswer_sdk/models/{relation_model.py → embedding_endpoint_import_failure.py} +8 -10
  50. qanswer_sdk/models/embedding_endpoint_import_response.py +99 -0
  51. qanswer_sdk/models/es_meta_data.py +98 -0
  52. qanswer_sdk/models/{get_file_es_meta_data_response.py → es_meta_data_value.py} +7 -11
  53. qanswer_sdk/models/feedback_update.py +4 -2
  54. qanswer_sdk/models/file_es_meta_data.py +31 -4
  55. qanswer_sdk/models/g_drive_download_request.py +3 -1
  56. qanswer_sdk/models/generate_ai_cells_payload.py +5 -3
  57. qanswer_sdk/models/highlight_audio_payload_model.py +6 -4
  58. qanswer_sdk/models/imap_add_payload.py +4 -2
  59. qanswer_sdk/models/list_socket_events.py +2 -2
  60. qanswer_sdk/models/llm_consumption.py +2 -2
  61. qanswer_sdk/models/llm_create_dto.py +25 -3
  62. qanswer_sdk/models/llm_detailed_dto.py +30 -4
  63. qanswer_sdk/models/llm_dto.py +18 -2
  64. qanswer_sdk/models/llm_endpoint.py +25 -3
  65. qanswer_sdk/models/llm_endpoint_import_failure.py +89 -0
  66. qanswer_sdk/models/{relation_extraction_data_output.py → llm_endpoint_import_response.py} +20 -16
  67. qanswer_sdk/models/llm_endpoint_read_input.py +25 -3
  68. qanswer_sdk/models/llm_endpoint_read_output.py +25 -3
  69. qanswer_sdk/models/llm_update_dto.py +25 -3
  70. qanswer_sdk/models/mcp_server.py +153 -0
  71. qanswer_sdk/models/mcp_server_create.py +4 -2
  72. qanswer_sdk/models/mcp_server_dto.py +6 -2
  73. qanswer_sdk/models/mcp_server_update.py +4 -2
  74. qanswer_sdk/models/mcp_tool.py +124 -0
  75. qanswer_sdk/models/mcp_tool_description_update.py +6 -4
  76. qanswer_sdk/models/mcp_tool_dto.py +3 -1
  77. qanswer_sdk/models/one_drive_download_request.py +3 -1
  78. qanswer_sdk/models/one_note_download_request.py +3 -1
  79. qanswer_sdk/models/organization_admin.py +4 -2
  80. qanswer_sdk/models/organization_filter_dto.py +4 -2
  81. qanswer_sdk/models/{relation_value_input.py → organization_mcp_server_setting.py} +29 -24
  82. qanswer_sdk/models/plan_dto.py +16 -4
  83. qanswer_sdk/models/publication_add_payload.py +4 -2
  84. qanswer_sdk/models/rag_payload.py +6 -2
  85. qanswer_sdk/models/report_copilot_generation_from_slots_payload.py +5 -3
  86. qanswer_sdk/models/report_copilot_refinement_payload.py +5 -3
  87. qanswer_sdk/models/report_copilot_slot_feedback_update.py +4 -2
  88. qanswer_sdk/models/report_template.py +3 -1
  89. qanswer_sdk/models/report_template_create_payload.py +4 -2
  90. qanswer_sdk/models/report_template_simplified.py +4 -2
  91. qanswer_sdk/models/report_template_update_payload.py +4 -2
  92. qanswer_sdk/models/report_templates_search_payload.py +104 -0
  93. qanswer_sdk/models/search_payload.py +6 -2
  94. qanswer_sdk/models/share_point_download_request.py +3 -1
  95. qanswer_sdk/models/socket_conversation_message.py +37 -7
  96. qanswer_sdk/models/template_toggle_request.py +5 -5
  97. qanswer_sdk/models/text2_sparql_payload.py +5 -1
  98. qanswer_sdk/models/thinking_block.py +91 -0
  99. qanswer_sdk/models/{subject_model.py → update_cells_payload.py} +10 -10
  100. qanswer_sdk/models/{relation_extraction_configuration.py → update_file_es_meta_data.py} +37 -26
  101. qanswer_sdk/models/{update_metadata_model.py → update_metadata_model_input.py} +7 -7
  102. qanswer_sdk/models/{relation_extraction_task_settings_update_payload.py → update_metadata_model_output.py} +14 -12
  103. qanswer_sdk/models/update_qn_a_pair_request.py +4 -2
  104. qanswer_sdk/models/{relation_extraction_template_payload.py → update_template_cells_payload.py} +19 -15
  105. qanswer_sdk/models/user.py +10 -5
  106. qanswer_sdk/models/user_credits_config_dto.py +95 -0
  107. qanswer_sdk/models/user_credits_dto.py +104 -0
  108. qanswer_sdk/models/user_dataset.py +31 -11
  109. qanswer_sdk/models/{relation_extraction_row_output.py → user_dataset_mcp_tool_selection.py} +33 -26
  110. qanswer_sdk/models/user_dataset_mcp_tool_selection_dto.py +3 -1
  111. qanswer_sdk/models/user_filter_dto.py +4 -2
  112. qanswer_sdk/models/{relation_extraction_row_input.py → user_mcp_tool_selection.py} +31 -26
  113. qanswer_sdk/models/user_mcp_tool_selection_dto.py +3 -1
  114. qanswer_sdk/models/user_profile_dto.py +16 -4
  115. qanswer_sdk/models/{value_model.py → websearch_scraping_site.py} +11 -17
  116. qanswer_sdk/models/website_add_payload.py +4 -2
  117. {qanswer_sdk-3.1509.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/METADATA +2 -2
  118. {qanswer_sdk-3.1509.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/RECORD +119 -112
  119. qanswer_sdk/api/task_relation_extraction_api.py +0 -3636
  120. qanswer_sdk/models/export_relation_extraction_table_request.py +0 -97
  121. qanswer_sdk/models/relation_extraction_payload.py +0 -117
  122. qanswer_sdk/models/relation_extraction_task_settings.py +0 -125
  123. qanswer_sdk/models/relation_extraction_task_update.py +0 -125
  124. qanswer_sdk/models/relation_value_output.py +0 -103
  125. qanswer_sdk/models/socket_data_extraction.py +0 -109
  126. {qanswer_sdk-3.1509.0.dist-info → qanswer_sdk-3.1510.0.dist-info}/WHEEL +0 -0
@@ -1,3636 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- QAnswer: Api Documentation
5
-
6
- APIs provided by QAnswer
7
-
8
- The version of the OpenAPI document: 1.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 pydantic import StrictBytes, StrictInt, StrictStr
20
- from typing import List, Optional, Tuple, Union
21
- from qanswer_sdk.models.export_relation_extraction_table_request import ExportRelationExtractionTableRequest
22
- from qanswer_sdk.models.relation_extraction_configuration import RelationExtractionConfiguration
23
- from qanswer_sdk.models.relation_extraction_data_output import RelationExtractionDataOutput
24
- from qanswer_sdk.models.relation_extraction_payload import RelationExtractionPayload
25
- from qanswer_sdk.models.relation_extraction_schema import RelationExtractionSchema
26
- from qanswer_sdk.models.relation_extraction_task_settings import RelationExtractionTaskSettings
27
- from qanswer_sdk.models.relation_extraction_task_settings_update_payload import RelationExtractionTaskSettingsUpdatePayload
28
- from qanswer_sdk.models.relation_extraction_template_payload import RelationExtractionTemplatePayload
29
-
30
- from qanswer_sdk.api_client import ApiClient, RequestSerialized
31
- from qanswer_sdk.api_response import ApiResponse
32
- from qanswer_sdk.rest import RESTResponseType
33
-
34
-
35
- class TaskRelationExtractionApi:
36
- """NOTE: This class is auto generated by OpenAPI Generator
37
- Ref: https://openapi-generator.tech
38
-
39
- Do not edit the class manually.
40
- """
41
-
42
- def __init__(self, api_client=None) -> None:
43
- if api_client is None:
44
- api_client = ApiClient.get_default()
45
- self.api_client = api_client
46
-
47
-
48
- @validate_call
49
- def create_relation_extraction_template(
50
- self,
51
- relation_extraction_template_payload: RelationExtractionTemplatePayload,
52
- q_answer_api_key: Optional[StrictStr] = None,
53
- _request_timeout: Union[
54
- None,
55
- Annotated[StrictFloat, Field(gt=0)],
56
- Tuple[
57
- Annotated[StrictFloat, Field(gt=0)],
58
- Annotated[StrictFloat, Field(gt=0)]
59
- ]
60
- ] = None,
61
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
- _content_type: Optional[StrictStr] = None,
63
- _headers: Optional[Dict[StrictStr, Any]] = None,
64
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
- ) -> RelationExtractionSchema:
66
- """Create a relation extraction template
67
-
68
-
69
- :param relation_extraction_template_payload: (required)
70
- :type relation_extraction_template_payload: RelationExtractionTemplatePayload
71
- :param q_answer_api_key:
72
- :type q_answer_api_key: str
73
- :param _request_timeout: timeout setting for this request. If one
74
- number provided, it will be total request
75
- timeout. It can also be a pair (tuple) of
76
- (connection, read) timeouts.
77
- :type _request_timeout: int, tuple(int, int), optional
78
- :param _request_auth: set to override the auth_settings for an a single
79
- request; this effectively ignores the
80
- authentication in the spec for a single request.
81
- :type _request_auth: dict, optional
82
- :param _content_type: force content-type for the request.
83
- :type _content_type: str, Optional
84
- :param _headers: set to override the headers for a single
85
- request; this effectively ignores the headers
86
- in the spec for a single request.
87
- :type _headers: dict, optional
88
- :param _host_index: set to override the host_index for a single
89
- request; this effectively ignores the host_index
90
- in the spec for a single request.
91
- :type _host_index: int, optional
92
- :return: Returns the result object.
93
- """ # noqa: E501
94
-
95
- _param = self._create_relation_extraction_template_serialize(
96
- relation_extraction_template_payload=relation_extraction_template_payload,
97
- q_answer_api_key=q_answer_api_key,
98
- _request_auth=_request_auth,
99
- _content_type=_content_type,
100
- _headers=_headers,
101
- _host_index=_host_index
102
- )
103
-
104
- _response_types_map: Dict[str, Optional[str]] = {
105
- '200': "RelationExtractionSchema",
106
- }
107
- response_data = self.api_client.call_api(
108
- *_param,
109
- _request_timeout=_request_timeout
110
- )
111
- response_data.read()
112
- return self.api_client.response_deserialize(
113
- response_data=response_data,
114
- response_types_map=_response_types_map,
115
- ).data
116
-
117
-
118
- @validate_call
119
- def create_relation_extraction_template_with_http_info(
120
- self,
121
- relation_extraction_template_payload: RelationExtractionTemplatePayload,
122
- q_answer_api_key: Optional[StrictStr] = None,
123
- _request_timeout: Union[
124
- None,
125
- Annotated[StrictFloat, Field(gt=0)],
126
- Tuple[
127
- Annotated[StrictFloat, Field(gt=0)],
128
- Annotated[StrictFloat, Field(gt=0)]
129
- ]
130
- ] = None,
131
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
132
- _content_type: Optional[StrictStr] = None,
133
- _headers: Optional[Dict[StrictStr, Any]] = None,
134
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
- ) -> ApiResponse[RelationExtractionSchema]:
136
- """Create a relation extraction template
137
-
138
-
139
- :param relation_extraction_template_payload: (required)
140
- :type relation_extraction_template_payload: RelationExtractionTemplatePayload
141
- :param q_answer_api_key:
142
- :type q_answer_api_key: str
143
- :param _request_timeout: timeout setting for this request. If one
144
- number provided, it will be total request
145
- timeout. It can also be a pair (tuple) of
146
- (connection, read) timeouts.
147
- :type _request_timeout: int, tuple(int, int), optional
148
- :param _request_auth: set to override the auth_settings for an a single
149
- request; this effectively ignores the
150
- authentication in the spec for a single request.
151
- :type _request_auth: dict, optional
152
- :param _content_type: force content-type for the request.
153
- :type _content_type: str, Optional
154
- :param _headers: set to override the headers for a single
155
- request; this effectively ignores the headers
156
- in the spec for a single request.
157
- :type _headers: dict, optional
158
- :param _host_index: set to override the host_index for a single
159
- request; this effectively ignores the host_index
160
- in the spec for a single request.
161
- :type _host_index: int, optional
162
- :return: Returns the result object.
163
- """ # noqa: E501
164
-
165
- _param = self._create_relation_extraction_template_serialize(
166
- relation_extraction_template_payload=relation_extraction_template_payload,
167
- q_answer_api_key=q_answer_api_key,
168
- _request_auth=_request_auth,
169
- _content_type=_content_type,
170
- _headers=_headers,
171
- _host_index=_host_index
172
- )
173
-
174
- _response_types_map: Dict[str, Optional[str]] = {
175
- '200': "RelationExtractionSchema",
176
- }
177
- response_data = self.api_client.call_api(
178
- *_param,
179
- _request_timeout=_request_timeout
180
- )
181
- response_data.read()
182
- return self.api_client.response_deserialize(
183
- response_data=response_data,
184
- response_types_map=_response_types_map,
185
- )
186
-
187
-
188
- @validate_call
189
- def create_relation_extraction_template_without_preload_content(
190
- self,
191
- relation_extraction_template_payload: RelationExtractionTemplatePayload,
192
- q_answer_api_key: Optional[StrictStr] = None,
193
- _request_timeout: Union[
194
- None,
195
- Annotated[StrictFloat, Field(gt=0)],
196
- Tuple[
197
- Annotated[StrictFloat, Field(gt=0)],
198
- Annotated[StrictFloat, Field(gt=0)]
199
- ]
200
- ] = None,
201
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
- _content_type: Optional[StrictStr] = None,
203
- _headers: Optional[Dict[StrictStr, Any]] = None,
204
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
- ) -> RESTResponseType:
206
- """Create a relation extraction template
207
-
208
-
209
- :param relation_extraction_template_payload: (required)
210
- :type relation_extraction_template_payload: RelationExtractionTemplatePayload
211
- :param q_answer_api_key:
212
- :type q_answer_api_key: str
213
- :param _request_timeout: timeout setting for this request. If one
214
- number provided, it will be total request
215
- timeout. It can also be a pair (tuple) of
216
- (connection, read) timeouts.
217
- :type _request_timeout: int, tuple(int, int), optional
218
- :param _request_auth: set to override the auth_settings for an a single
219
- request; this effectively ignores the
220
- authentication in the spec for a single request.
221
- :type _request_auth: dict, optional
222
- :param _content_type: force content-type for the request.
223
- :type _content_type: str, Optional
224
- :param _headers: set to override the headers for a single
225
- request; this effectively ignores the headers
226
- in the spec for a single request.
227
- :type _headers: dict, optional
228
- :param _host_index: set to override the host_index for a single
229
- request; this effectively ignores the host_index
230
- in the spec for a single request.
231
- :type _host_index: int, optional
232
- :return: Returns the result object.
233
- """ # noqa: E501
234
-
235
- _param = self._create_relation_extraction_template_serialize(
236
- relation_extraction_template_payload=relation_extraction_template_payload,
237
- q_answer_api_key=q_answer_api_key,
238
- _request_auth=_request_auth,
239
- _content_type=_content_type,
240
- _headers=_headers,
241
- _host_index=_host_index
242
- )
243
-
244
- _response_types_map: Dict[str, Optional[str]] = {
245
- '200': "RelationExtractionSchema",
246
- }
247
- response_data = self.api_client.call_api(
248
- *_param,
249
- _request_timeout=_request_timeout
250
- )
251
- return response_data.response
252
-
253
-
254
- def _create_relation_extraction_template_serialize(
255
- self,
256
- relation_extraction_template_payload,
257
- q_answer_api_key,
258
- _request_auth,
259
- _content_type,
260
- _headers,
261
- _host_index,
262
- ) -> RequestSerialized:
263
-
264
- _host = None
265
-
266
- _collection_formats: Dict[str, str] = {
267
- }
268
-
269
- _path_params: Dict[str, str] = {}
270
- _query_params: List[Tuple[str, str]] = []
271
- _header_params: Dict[str, Optional[str]] = _headers or {}
272
- _form_params: List[Tuple[str, str]] = []
273
- _files: Dict[
274
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
275
- ] = {}
276
- _body_params: Optional[bytes] = None
277
-
278
- # process the path parameters
279
- # process the query parameters
280
- # process the header parameters
281
- if q_answer_api_key is not None:
282
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
283
- # process the form parameters
284
- # process the body parameter
285
- if relation_extraction_template_payload is not None:
286
- _body_params = relation_extraction_template_payload
287
-
288
-
289
- # set the HTTP header `Accept`
290
- if 'Accept' not in _header_params:
291
- _header_params['Accept'] = self.api_client.select_header_accept(
292
- [
293
- '*/*'
294
- ]
295
- )
296
-
297
- # set the HTTP header `Content-Type`
298
- if _content_type:
299
- _header_params['Content-Type'] = _content_type
300
- else:
301
- _default_content_type = (
302
- self.api_client.select_header_content_type(
303
- [
304
- 'application/json'
305
- ]
306
- )
307
- )
308
- if _default_content_type is not None:
309
- _header_params['Content-Type'] = _default_content_type
310
-
311
- # authentication setting
312
- _auth_settings: List[str] = [
313
- 'QAnswer-Api-Key',
314
- 'Bearer'
315
- ]
316
-
317
- return self.api_client.param_serialize(
318
- method='POST',
319
- resource_path='/api/tasks/relation-extraction/templates',
320
- path_params=_path_params,
321
- query_params=_query_params,
322
- header_params=_header_params,
323
- body=_body_params,
324
- post_params=_form_params,
325
- files=_files,
326
- auth_settings=_auth_settings,
327
- collection_formats=_collection_formats,
328
- _host=_host,
329
- _request_auth=_request_auth
330
- )
331
-
332
-
333
-
334
-
335
- @validate_call
336
- def delete_relation_extraction_template(
337
- self,
338
- username: StrictStr,
339
- dataset: StrictStr,
340
- template_id: StrictInt,
341
- q_answer_api_key: Optional[StrictStr] = None,
342
- _request_timeout: Union[
343
- None,
344
- Annotated[StrictFloat, Field(gt=0)],
345
- Tuple[
346
- Annotated[StrictFloat, Field(gt=0)],
347
- Annotated[StrictFloat, Field(gt=0)]
348
- ]
349
- ] = None,
350
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
351
- _content_type: Optional[StrictStr] = None,
352
- _headers: Optional[Dict[StrictStr, Any]] = None,
353
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
354
- ) -> None:
355
- """Delete a relation extraction template
356
-
357
-
358
- :param username: (required)
359
- :type username: str
360
- :param dataset: (required)
361
- :type dataset: str
362
- :param template_id: (required)
363
- :type template_id: int
364
- :param q_answer_api_key:
365
- :type q_answer_api_key: str
366
- :param _request_timeout: timeout setting for this request. If one
367
- number provided, it will be total request
368
- timeout. It can also be a pair (tuple) of
369
- (connection, read) timeouts.
370
- :type _request_timeout: int, tuple(int, int), optional
371
- :param _request_auth: set to override the auth_settings for an a single
372
- request; this effectively ignores the
373
- authentication in the spec for a single request.
374
- :type _request_auth: dict, optional
375
- :param _content_type: force content-type for the request.
376
- :type _content_type: str, Optional
377
- :param _headers: set to override the headers for a single
378
- request; this effectively ignores the headers
379
- in the spec for a single request.
380
- :type _headers: dict, optional
381
- :param _host_index: set to override the host_index for a single
382
- request; this effectively ignores the host_index
383
- in the spec for a single request.
384
- :type _host_index: int, optional
385
- :return: Returns the result object.
386
- """ # noqa: E501
387
-
388
- _param = self._delete_relation_extraction_template_serialize(
389
- username=username,
390
- dataset=dataset,
391
- template_id=template_id,
392
- q_answer_api_key=q_answer_api_key,
393
- _request_auth=_request_auth,
394
- _content_type=_content_type,
395
- _headers=_headers,
396
- _host_index=_host_index
397
- )
398
-
399
- _response_types_map: Dict[str, Optional[str]] = {
400
- '200': None,
401
- }
402
- response_data = self.api_client.call_api(
403
- *_param,
404
- _request_timeout=_request_timeout
405
- )
406
- response_data.read()
407
- return self.api_client.response_deserialize(
408
- response_data=response_data,
409
- response_types_map=_response_types_map,
410
- ).data
411
-
412
-
413
- @validate_call
414
- def delete_relation_extraction_template_with_http_info(
415
- self,
416
- username: StrictStr,
417
- dataset: StrictStr,
418
- template_id: StrictInt,
419
- q_answer_api_key: Optional[StrictStr] = None,
420
- _request_timeout: Union[
421
- None,
422
- Annotated[StrictFloat, Field(gt=0)],
423
- Tuple[
424
- Annotated[StrictFloat, Field(gt=0)],
425
- Annotated[StrictFloat, Field(gt=0)]
426
- ]
427
- ] = None,
428
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
429
- _content_type: Optional[StrictStr] = None,
430
- _headers: Optional[Dict[StrictStr, Any]] = None,
431
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
432
- ) -> ApiResponse[None]:
433
- """Delete a relation extraction template
434
-
435
-
436
- :param username: (required)
437
- :type username: str
438
- :param dataset: (required)
439
- :type dataset: str
440
- :param template_id: (required)
441
- :type template_id: int
442
- :param q_answer_api_key:
443
- :type q_answer_api_key: str
444
- :param _request_timeout: timeout setting for this request. If one
445
- number provided, it will be total request
446
- timeout. It can also be a pair (tuple) of
447
- (connection, read) timeouts.
448
- :type _request_timeout: int, tuple(int, int), optional
449
- :param _request_auth: set to override the auth_settings for an a single
450
- request; this effectively ignores the
451
- authentication in the spec for a single request.
452
- :type _request_auth: dict, optional
453
- :param _content_type: force content-type for the request.
454
- :type _content_type: str, Optional
455
- :param _headers: set to override the headers for a single
456
- request; this effectively ignores the headers
457
- in the spec for a single request.
458
- :type _headers: dict, optional
459
- :param _host_index: set to override the host_index for a single
460
- request; this effectively ignores the host_index
461
- in the spec for a single request.
462
- :type _host_index: int, optional
463
- :return: Returns the result object.
464
- """ # noqa: E501
465
-
466
- _param = self._delete_relation_extraction_template_serialize(
467
- username=username,
468
- dataset=dataset,
469
- template_id=template_id,
470
- q_answer_api_key=q_answer_api_key,
471
- _request_auth=_request_auth,
472
- _content_type=_content_type,
473
- _headers=_headers,
474
- _host_index=_host_index
475
- )
476
-
477
- _response_types_map: Dict[str, Optional[str]] = {
478
- '200': None,
479
- }
480
- response_data = self.api_client.call_api(
481
- *_param,
482
- _request_timeout=_request_timeout
483
- )
484
- response_data.read()
485
- return self.api_client.response_deserialize(
486
- response_data=response_data,
487
- response_types_map=_response_types_map,
488
- )
489
-
490
-
491
- @validate_call
492
- def delete_relation_extraction_template_without_preload_content(
493
- self,
494
- username: StrictStr,
495
- dataset: StrictStr,
496
- template_id: StrictInt,
497
- q_answer_api_key: Optional[StrictStr] = None,
498
- _request_timeout: Union[
499
- None,
500
- Annotated[StrictFloat, Field(gt=0)],
501
- Tuple[
502
- Annotated[StrictFloat, Field(gt=0)],
503
- Annotated[StrictFloat, Field(gt=0)]
504
- ]
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
- ) -> RESTResponseType:
511
- """Delete a relation extraction template
512
-
513
-
514
- :param username: (required)
515
- :type username: str
516
- :param dataset: (required)
517
- :type dataset: str
518
- :param template_id: (required)
519
- :type template_id: int
520
- :param q_answer_api_key:
521
- :type q_answer_api_key: str
522
- :param _request_timeout: timeout setting for this request. If one
523
- number provided, it will be total request
524
- timeout. It can also be a pair (tuple) of
525
- (connection, read) timeouts.
526
- :type _request_timeout: int, tuple(int, int), optional
527
- :param _request_auth: set to override the auth_settings for an a single
528
- request; this effectively ignores the
529
- authentication in the spec for a single request.
530
- :type _request_auth: dict, optional
531
- :param _content_type: force content-type for the request.
532
- :type _content_type: str, Optional
533
- :param _headers: set to override the headers for a single
534
- request; this effectively ignores the headers
535
- in the spec for a single request.
536
- :type _headers: dict, optional
537
- :param _host_index: set to override the host_index for a single
538
- request; this effectively ignores the host_index
539
- in the spec for a single request.
540
- :type _host_index: int, optional
541
- :return: Returns the result object.
542
- """ # noqa: E501
543
-
544
- _param = self._delete_relation_extraction_template_serialize(
545
- username=username,
546
- dataset=dataset,
547
- template_id=template_id,
548
- q_answer_api_key=q_answer_api_key,
549
- _request_auth=_request_auth,
550
- _content_type=_content_type,
551
- _headers=_headers,
552
- _host_index=_host_index
553
- )
554
-
555
- _response_types_map: Dict[str, Optional[str]] = {
556
- '200': None,
557
- }
558
- response_data = self.api_client.call_api(
559
- *_param,
560
- _request_timeout=_request_timeout
561
- )
562
- return response_data.response
563
-
564
-
565
- def _delete_relation_extraction_template_serialize(
566
- self,
567
- username,
568
- dataset,
569
- template_id,
570
- q_answer_api_key,
571
- _request_auth,
572
- _content_type,
573
- _headers,
574
- _host_index,
575
- ) -> RequestSerialized:
576
-
577
- _host = None
578
-
579
- _collection_formats: Dict[str, str] = {
580
- }
581
-
582
- _path_params: Dict[str, str] = {}
583
- _query_params: List[Tuple[str, str]] = []
584
- _header_params: Dict[str, Optional[str]] = _headers or {}
585
- _form_params: List[Tuple[str, str]] = []
586
- _files: Dict[
587
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
588
- ] = {}
589
- _body_params: Optional[bytes] = None
590
-
591
- # process the path parameters
592
- if template_id is not None:
593
- _path_params['templateId'] = template_id
594
- # process the query parameters
595
- if username is not None:
596
-
597
- _query_params.append(('username', username))
598
-
599
- if dataset is not None:
600
-
601
- _query_params.append(('dataset', dataset))
602
-
603
- # process the header parameters
604
- if q_answer_api_key is not None:
605
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
606
- # process the form parameters
607
- # process the body parameter
608
-
609
-
610
-
611
-
612
- # authentication setting
613
- _auth_settings: List[str] = [
614
- 'QAnswer-Api-Key',
615
- 'Bearer'
616
- ]
617
-
618
- return self.api_client.param_serialize(
619
- method='DELETE',
620
- resource_path='/api/tasks/relation-extraction/templates/{templateId}',
621
- path_params=_path_params,
622
- query_params=_query_params,
623
- header_params=_header_params,
624
- body=_body_params,
625
- post_params=_form_params,
626
- files=_files,
627
- auth_settings=_auth_settings,
628
- collection_formats=_collection_formats,
629
- _host=_host,
630
- _request_auth=_request_auth
631
- )
632
-
633
-
634
-
635
-
636
- @validate_call
637
- def export_relation_extraction_table(
638
- self,
639
- username: StrictStr,
640
- dataset: StrictStr,
641
- export_relation_extraction_table_request: ExportRelationExtractionTableRequest,
642
- format: Optional[StrictStr] = None,
643
- q_answer_api_key: Optional[StrictStr] = None,
644
- _request_timeout: Union[
645
- None,
646
- Annotated[StrictFloat, Field(gt=0)],
647
- Tuple[
648
- Annotated[StrictFloat, Field(gt=0)],
649
- Annotated[StrictFloat, Field(gt=0)]
650
- ]
651
- ] = None,
652
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
653
- _content_type: Optional[StrictStr] = None,
654
- _headers: Optional[Dict[StrictStr, Any]] = None,
655
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
656
- ) -> bytearray:
657
- """Export a relation extraction table
658
-
659
-
660
- :param username: (required)
661
- :type username: str
662
- :param dataset: (required)
663
- :type dataset: str
664
- :param export_relation_extraction_table_request: (required)
665
- :type export_relation_extraction_table_request: ExportRelationExtractionTableRequest
666
- :param format:
667
- :type format: str
668
- :param q_answer_api_key:
669
- :type q_answer_api_key: str
670
- :param _request_timeout: timeout setting for this request. If one
671
- number provided, it will be total request
672
- timeout. It can also be a pair (tuple) of
673
- (connection, read) timeouts.
674
- :type _request_timeout: int, tuple(int, int), optional
675
- :param _request_auth: set to override the auth_settings for an a single
676
- request; this effectively ignores the
677
- authentication in the spec for a single request.
678
- :type _request_auth: dict, optional
679
- :param _content_type: force content-type for the request.
680
- :type _content_type: str, Optional
681
- :param _headers: set to override the headers for a single
682
- request; this effectively ignores the headers
683
- in the spec for a single request.
684
- :type _headers: dict, optional
685
- :param _host_index: set to override the host_index for a single
686
- request; this effectively ignores the host_index
687
- in the spec for a single request.
688
- :type _host_index: int, optional
689
- :return: Returns the result object.
690
- """ # noqa: E501
691
-
692
- _param = self._export_relation_extraction_table_serialize(
693
- username=username,
694
- dataset=dataset,
695
- export_relation_extraction_table_request=export_relation_extraction_table_request,
696
- format=format,
697
- q_answer_api_key=q_answer_api_key,
698
- _request_auth=_request_auth,
699
- _content_type=_content_type,
700
- _headers=_headers,
701
- _host_index=_host_index
702
- )
703
-
704
- _response_types_map: Dict[str, Optional[str]] = {
705
- '200': "bytearray",
706
- }
707
- response_data = self.api_client.call_api(
708
- *_param,
709
- _request_timeout=_request_timeout
710
- )
711
- response_data.read()
712
- return self.api_client.response_deserialize(
713
- response_data=response_data,
714
- response_types_map=_response_types_map,
715
- ).data
716
-
717
-
718
- @validate_call
719
- def export_relation_extraction_table_with_http_info(
720
- self,
721
- username: StrictStr,
722
- dataset: StrictStr,
723
- export_relation_extraction_table_request: ExportRelationExtractionTableRequest,
724
- format: Optional[StrictStr] = None,
725
- q_answer_api_key: Optional[StrictStr] = None,
726
- _request_timeout: Union[
727
- None,
728
- Annotated[StrictFloat, Field(gt=0)],
729
- Tuple[
730
- Annotated[StrictFloat, Field(gt=0)],
731
- Annotated[StrictFloat, Field(gt=0)]
732
- ]
733
- ] = None,
734
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
735
- _content_type: Optional[StrictStr] = None,
736
- _headers: Optional[Dict[StrictStr, Any]] = None,
737
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
738
- ) -> ApiResponse[bytearray]:
739
- """Export a relation extraction table
740
-
741
-
742
- :param username: (required)
743
- :type username: str
744
- :param dataset: (required)
745
- :type dataset: str
746
- :param export_relation_extraction_table_request: (required)
747
- :type export_relation_extraction_table_request: ExportRelationExtractionTableRequest
748
- :param format:
749
- :type format: str
750
- :param q_answer_api_key:
751
- :type q_answer_api_key: str
752
- :param _request_timeout: timeout setting for this request. If one
753
- number provided, it will be total request
754
- timeout. It can also be a pair (tuple) of
755
- (connection, read) timeouts.
756
- :type _request_timeout: int, tuple(int, int), optional
757
- :param _request_auth: set to override the auth_settings for an a single
758
- request; this effectively ignores the
759
- authentication in the spec for a single request.
760
- :type _request_auth: dict, optional
761
- :param _content_type: force content-type for the request.
762
- :type _content_type: str, Optional
763
- :param _headers: set to override the headers for a single
764
- request; this effectively ignores the headers
765
- in the spec for a single request.
766
- :type _headers: dict, optional
767
- :param _host_index: set to override the host_index for a single
768
- request; this effectively ignores the host_index
769
- in the spec for a single request.
770
- :type _host_index: int, optional
771
- :return: Returns the result object.
772
- """ # noqa: E501
773
-
774
- _param = self._export_relation_extraction_table_serialize(
775
- username=username,
776
- dataset=dataset,
777
- export_relation_extraction_table_request=export_relation_extraction_table_request,
778
- format=format,
779
- q_answer_api_key=q_answer_api_key,
780
- _request_auth=_request_auth,
781
- _content_type=_content_type,
782
- _headers=_headers,
783
- _host_index=_host_index
784
- )
785
-
786
- _response_types_map: Dict[str, Optional[str]] = {
787
- '200': "bytearray",
788
- }
789
- response_data = self.api_client.call_api(
790
- *_param,
791
- _request_timeout=_request_timeout
792
- )
793
- response_data.read()
794
- return self.api_client.response_deserialize(
795
- response_data=response_data,
796
- response_types_map=_response_types_map,
797
- )
798
-
799
-
800
- @validate_call
801
- def export_relation_extraction_table_without_preload_content(
802
- self,
803
- username: StrictStr,
804
- dataset: StrictStr,
805
- export_relation_extraction_table_request: ExportRelationExtractionTableRequest,
806
- format: Optional[StrictStr] = None,
807
- q_answer_api_key: Optional[StrictStr] = None,
808
- _request_timeout: Union[
809
- None,
810
- Annotated[StrictFloat, Field(gt=0)],
811
- Tuple[
812
- Annotated[StrictFloat, Field(gt=0)],
813
- Annotated[StrictFloat, Field(gt=0)]
814
- ]
815
- ] = None,
816
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
817
- _content_type: Optional[StrictStr] = None,
818
- _headers: Optional[Dict[StrictStr, Any]] = None,
819
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
820
- ) -> RESTResponseType:
821
- """Export a relation extraction table
822
-
823
-
824
- :param username: (required)
825
- :type username: str
826
- :param dataset: (required)
827
- :type dataset: str
828
- :param export_relation_extraction_table_request: (required)
829
- :type export_relation_extraction_table_request: ExportRelationExtractionTableRequest
830
- :param format:
831
- :type format: str
832
- :param q_answer_api_key:
833
- :type q_answer_api_key: str
834
- :param _request_timeout: timeout setting for this request. If one
835
- number provided, it will be total request
836
- timeout. It can also be a pair (tuple) of
837
- (connection, read) timeouts.
838
- :type _request_timeout: int, tuple(int, int), optional
839
- :param _request_auth: set to override the auth_settings for an a single
840
- request; this effectively ignores the
841
- authentication in the spec for a single request.
842
- :type _request_auth: dict, optional
843
- :param _content_type: force content-type for the request.
844
- :type _content_type: str, Optional
845
- :param _headers: set to override the headers for a single
846
- request; this effectively ignores the headers
847
- in the spec for a single request.
848
- :type _headers: dict, optional
849
- :param _host_index: set to override the host_index for a single
850
- request; this effectively ignores the host_index
851
- in the spec for a single request.
852
- :type _host_index: int, optional
853
- :return: Returns the result object.
854
- """ # noqa: E501
855
-
856
- _param = self._export_relation_extraction_table_serialize(
857
- username=username,
858
- dataset=dataset,
859
- export_relation_extraction_table_request=export_relation_extraction_table_request,
860
- format=format,
861
- q_answer_api_key=q_answer_api_key,
862
- _request_auth=_request_auth,
863
- _content_type=_content_type,
864
- _headers=_headers,
865
- _host_index=_host_index
866
- )
867
-
868
- _response_types_map: Dict[str, Optional[str]] = {
869
- '200': "bytearray",
870
- }
871
- response_data = self.api_client.call_api(
872
- *_param,
873
- _request_timeout=_request_timeout
874
- )
875
- return response_data.response
876
-
877
-
878
- def _export_relation_extraction_table_serialize(
879
- self,
880
- username,
881
- dataset,
882
- export_relation_extraction_table_request,
883
- format,
884
- q_answer_api_key,
885
- _request_auth,
886
- _content_type,
887
- _headers,
888
- _host_index,
889
- ) -> RequestSerialized:
890
-
891
- _host = None
892
-
893
- _collection_formats: Dict[str, str] = {
894
- }
895
-
896
- _path_params: Dict[str, str] = {}
897
- _query_params: List[Tuple[str, str]] = []
898
- _header_params: Dict[str, Optional[str]] = _headers or {}
899
- _form_params: List[Tuple[str, str]] = []
900
- _files: Dict[
901
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
902
- ] = {}
903
- _body_params: Optional[bytes] = None
904
-
905
- # process the path parameters
906
- # process the query parameters
907
- if username is not None:
908
-
909
- _query_params.append(('username', username))
910
-
911
- if dataset is not None:
912
-
913
- _query_params.append(('dataset', dataset))
914
-
915
- if format is not None:
916
-
917
- _query_params.append(('format', format))
918
-
919
- # process the header parameters
920
- if q_answer_api_key is not None:
921
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
922
- # process the form parameters
923
- # process the body parameter
924
- if export_relation_extraction_table_request is not None:
925
- _body_params = export_relation_extraction_table_request
926
-
927
-
928
- # set the HTTP header `Accept`
929
- if 'Accept' not in _header_params:
930
- _header_params['Accept'] = self.api_client.select_header_accept(
931
- [
932
- '*/*'
933
- ]
934
- )
935
-
936
- # set the HTTP header `Content-Type`
937
- if _content_type:
938
- _header_params['Content-Type'] = _content_type
939
- else:
940
- _default_content_type = (
941
- self.api_client.select_header_content_type(
942
- [
943
- 'application/json'
944
- ]
945
- )
946
- )
947
- if _default_content_type is not None:
948
- _header_params['Content-Type'] = _default_content_type
949
-
950
- # authentication setting
951
- _auth_settings: List[str] = [
952
- 'QAnswer-Api-Key',
953
- 'Bearer'
954
- ]
955
-
956
- return self.api_client.param_serialize(
957
- method='POST',
958
- resource_path='/api/tasks/relation-extraction/templates/export',
959
- path_params=_path_params,
960
- query_params=_query_params,
961
- header_params=_header_params,
962
- body=_body_params,
963
- post_params=_form_params,
964
- files=_files,
965
- auth_settings=_auth_settings,
966
- collection_formats=_collection_formats,
967
- _host=_host,
968
- _request_auth=_request_auth
969
- )
970
-
971
-
972
-
973
-
974
- @validate_call
975
- def free_text_relation_extraction_task_read_settings(
976
- self,
977
- username: StrictStr,
978
- dataset: StrictStr,
979
- q_answer_api_key: Optional[StrictStr] = None,
980
- _request_timeout: Union[
981
- None,
982
- Annotated[StrictFloat, Field(gt=0)],
983
- Tuple[
984
- Annotated[StrictFloat, Field(gt=0)],
985
- Annotated[StrictFloat, Field(gt=0)]
986
- ]
987
- ] = None,
988
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
989
- _content_type: Optional[StrictStr] = None,
990
- _headers: Optional[Dict[StrictStr, Any]] = None,
991
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
992
- ) -> RelationExtractionTaskSettings:
993
- """This reads the settings of the relation-extraction task
994
-
995
-
996
- :param username: (required)
997
- :type username: str
998
- :param dataset: (required)
999
- :type dataset: str
1000
- :param q_answer_api_key:
1001
- :type q_answer_api_key: str
1002
- :param _request_timeout: timeout setting for this request. If one
1003
- number provided, it will be total request
1004
- timeout. It can also be a pair (tuple) of
1005
- (connection, read) timeouts.
1006
- :type _request_timeout: int, tuple(int, int), optional
1007
- :param _request_auth: set to override the auth_settings for an a single
1008
- request; this effectively ignores the
1009
- authentication in the spec for a single request.
1010
- :type _request_auth: dict, optional
1011
- :param _content_type: force content-type for the request.
1012
- :type _content_type: str, Optional
1013
- :param _headers: set to override the headers for a single
1014
- request; this effectively ignores the headers
1015
- in the spec for a single request.
1016
- :type _headers: dict, optional
1017
- :param _host_index: set to override the host_index for a single
1018
- request; this effectively ignores the host_index
1019
- in the spec for a single request.
1020
- :type _host_index: int, optional
1021
- :return: Returns the result object.
1022
- """ # noqa: E501
1023
-
1024
- _param = self._free_text_relation_extraction_task_read_settings_serialize(
1025
- username=username,
1026
- dataset=dataset,
1027
- q_answer_api_key=q_answer_api_key,
1028
- _request_auth=_request_auth,
1029
- _content_type=_content_type,
1030
- _headers=_headers,
1031
- _host_index=_host_index
1032
- )
1033
-
1034
- _response_types_map: Dict[str, Optional[str]] = {
1035
- '200': "RelationExtractionTaskSettings",
1036
- }
1037
- response_data = self.api_client.call_api(
1038
- *_param,
1039
- _request_timeout=_request_timeout
1040
- )
1041
- response_data.read()
1042
- return self.api_client.response_deserialize(
1043
- response_data=response_data,
1044
- response_types_map=_response_types_map,
1045
- ).data
1046
-
1047
-
1048
- @validate_call
1049
- def free_text_relation_extraction_task_read_settings_with_http_info(
1050
- self,
1051
- username: StrictStr,
1052
- dataset: StrictStr,
1053
- q_answer_api_key: Optional[StrictStr] = None,
1054
- _request_timeout: Union[
1055
- None,
1056
- Annotated[StrictFloat, Field(gt=0)],
1057
- Tuple[
1058
- Annotated[StrictFloat, Field(gt=0)],
1059
- Annotated[StrictFloat, Field(gt=0)]
1060
- ]
1061
- ] = None,
1062
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1063
- _content_type: Optional[StrictStr] = None,
1064
- _headers: Optional[Dict[StrictStr, Any]] = None,
1065
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1066
- ) -> ApiResponse[RelationExtractionTaskSettings]:
1067
- """This reads the settings of the relation-extraction task
1068
-
1069
-
1070
- :param username: (required)
1071
- :type username: str
1072
- :param dataset: (required)
1073
- :type dataset: str
1074
- :param q_answer_api_key:
1075
- :type q_answer_api_key: str
1076
- :param _request_timeout: timeout setting for this request. If one
1077
- number provided, it will be total request
1078
- timeout. It can also be a pair (tuple) of
1079
- (connection, read) timeouts.
1080
- :type _request_timeout: int, tuple(int, int), optional
1081
- :param _request_auth: set to override the auth_settings for an a single
1082
- request; this effectively ignores the
1083
- authentication in the spec for a single request.
1084
- :type _request_auth: dict, optional
1085
- :param _content_type: force content-type for the request.
1086
- :type _content_type: str, Optional
1087
- :param _headers: set to override the headers for a single
1088
- request; this effectively ignores the headers
1089
- in the spec for a single request.
1090
- :type _headers: dict, optional
1091
- :param _host_index: set to override the host_index for a single
1092
- request; this effectively ignores the host_index
1093
- in the spec for a single request.
1094
- :type _host_index: int, optional
1095
- :return: Returns the result object.
1096
- """ # noqa: E501
1097
-
1098
- _param = self._free_text_relation_extraction_task_read_settings_serialize(
1099
- username=username,
1100
- dataset=dataset,
1101
- q_answer_api_key=q_answer_api_key,
1102
- _request_auth=_request_auth,
1103
- _content_type=_content_type,
1104
- _headers=_headers,
1105
- _host_index=_host_index
1106
- )
1107
-
1108
- _response_types_map: Dict[str, Optional[str]] = {
1109
- '200': "RelationExtractionTaskSettings",
1110
- }
1111
- response_data = self.api_client.call_api(
1112
- *_param,
1113
- _request_timeout=_request_timeout
1114
- )
1115
- response_data.read()
1116
- return self.api_client.response_deserialize(
1117
- response_data=response_data,
1118
- response_types_map=_response_types_map,
1119
- )
1120
-
1121
-
1122
- @validate_call
1123
- def free_text_relation_extraction_task_read_settings_without_preload_content(
1124
- self,
1125
- username: StrictStr,
1126
- dataset: StrictStr,
1127
- q_answer_api_key: Optional[StrictStr] = None,
1128
- _request_timeout: Union[
1129
- None,
1130
- Annotated[StrictFloat, Field(gt=0)],
1131
- Tuple[
1132
- Annotated[StrictFloat, Field(gt=0)],
1133
- Annotated[StrictFloat, Field(gt=0)]
1134
- ]
1135
- ] = None,
1136
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1137
- _content_type: Optional[StrictStr] = None,
1138
- _headers: Optional[Dict[StrictStr, Any]] = None,
1139
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1140
- ) -> RESTResponseType:
1141
- """This reads the settings of the relation-extraction task
1142
-
1143
-
1144
- :param username: (required)
1145
- :type username: str
1146
- :param dataset: (required)
1147
- :type dataset: str
1148
- :param q_answer_api_key:
1149
- :type q_answer_api_key: str
1150
- :param _request_timeout: timeout setting for this request. If one
1151
- number provided, it will be total request
1152
- timeout. It can also be a pair (tuple) of
1153
- (connection, read) timeouts.
1154
- :type _request_timeout: int, tuple(int, int), optional
1155
- :param _request_auth: set to override the auth_settings for an a single
1156
- request; this effectively ignores the
1157
- authentication in the spec for a single request.
1158
- :type _request_auth: dict, optional
1159
- :param _content_type: force content-type for the request.
1160
- :type _content_type: str, Optional
1161
- :param _headers: set to override the headers for a single
1162
- request; this effectively ignores the headers
1163
- in the spec for a single request.
1164
- :type _headers: dict, optional
1165
- :param _host_index: set to override the host_index for a single
1166
- request; this effectively ignores the host_index
1167
- in the spec for a single request.
1168
- :type _host_index: int, optional
1169
- :return: Returns the result object.
1170
- """ # noqa: E501
1171
-
1172
- _param = self._free_text_relation_extraction_task_read_settings_serialize(
1173
- username=username,
1174
- dataset=dataset,
1175
- q_answer_api_key=q_answer_api_key,
1176
- _request_auth=_request_auth,
1177
- _content_type=_content_type,
1178
- _headers=_headers,
1179
- _host_index=_host_index
1180
- )
1181
-
1182
- _response_types_map: Dict[str, Optional[str]] = {
1183
- '200': "RelationExtractionTaskSettings",
1184
- }
1185
- response_data = self.api_client.call_api(
1186
- *_param,
1187
- _request_timeout=_request_timeout
1188
- )
1189
- return response_data.response
1190
-
1191
-
1192
- def _free_text_relation_extraction_task_read_settings_serialize(
1193
- self,
1194
- username,
1195
- dataset,
1196
- q_answer_api_key,
1197
- _request_auth,
1198
- _content_type,
1199
- _headers,
1200
- _host_index,
1201
- ) -> RequestSerialized:
1202
-
1203
- _host = None
1204
-
1205
- _collection_formats: Dict[str, str] = {
1206
- }
1207
-
1208
- _path_params: Dict[str, str] = {}
1209
- _query_params: List[Tuple[str, str]] = []
1210
- _header_params: Dict[str, Optional[str]] = _headers or {}
1211
- _form_params: List[Tuple[str, str]] = []
1212
- _files: Dict[
1213
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1214
- ] = {}
1215
- _body_params: Optional[bytes] = None
1216
-
1217
- # process the path parameters
1218
- # process the query parameters
1219
- if username is not None:
1220
-
1221
- _query_params.append(('username', username))
1222
-
1223
- if dataset is not None:
1224
-
1225
- _query_params.append(('dataset', dataset))
1226
-
1227
- # process the header parameters
1228
- if q_answer_api_key is not None:
1229
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
1230
- # process the form parameters
1231
- # process the body parameter
1232
-
1233
-
1234
- # set the HTTP header `Accept`
1235
- if 'Accept' not in _header_params:
1236
- _header_params['Accept'] = self.api_client.select_header_accept(
1237
- [
1238
- '*/*'
1239
- ]
1240
- )
1241
-
1242
-
1243
- # authentication setting
1244
- _auth_settings: List[str] = [
1245
- 'QAnswer-Api-Key',
1246
- 'Bearer'
1247
- ]
1248
-
1249
- return self.api_client.param_serialize(
1250
- method='GET',
1251
- resource_path='/api/tasks/relation-extraction/settings',
1252
- path_params=_path_params,
1253
- query_params=_query_params,
1254
- header_params=_header_params,
1255
- body=_body_params,
1256
- post_params=_form_params,
1257
- files=_files,
1258
- auth_settings=_auth_settings,
1259
- collection_formats=_collection_formats,
1260
- _host=_host,
1261
- _request_auth=_request_auth
1262
- )
1263
-
1264
-
1265
-
1266
-
1267
- @validate_call
1268
- def free_text_relation_extraction_task_update_settings(
1269
- self,
1270
- relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload,
1271
- q_answer_api_key: Optional[StrictStr] = None,
1272
- _request_timeout: Union[
1273
- None,
1274
- Annotated[StrictFloat, Field(gt=0)],
1275
- Tuple[
1276
- Annotated[StrictFloat, Field(gt=0)],
1277
- Annotated[StrictFloat, Field(gt=0)]
1278
- ]
1279
- ] = None,
1280
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1281
- _content_type: Optional[StrictStr] = None,
1282
- _headers: Optional[Dict[StrictStr, Any]] = None,
1283
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1284
- ) -> RelationExtractionTaskSettings:
1285
- """This updates the settings of the relation-extraction task
1286
-
1287
-
1288
- :param relation_extraction_task_settings_update_payload: (required)
1289
- :type relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload
1290
- :param q_answer_api_key:
1291
- :type q_answer_api_key: str
1292
- :param _request_timeout: timeout setting for this request. If one
1293
- number provided, it will be total request
1294
- timeout. It can also be a pair (tuple) of
1295
- (connection, read) timeouts.
1296
- :type _request_timeout: int, tuple(int, int), optional
1297
- :param _request_auth: set to override the auth_settings for an a single
1298
- request; this effectively ignores the
1299
- authentication in the spec for a single request.
1300
- :type _request_auth: dict, optional
1301
- :param _content_type: force content-type for the request.
1302
- :type _content_type: str, Optional
1303
- :param _headers: set to override the headers for a single
1304
- request; this effectively ignores the headers
1305
- in the spec for a single request.
1306
- :type _headers: dict, optional
1307
- :param _host_index: set to override the host_index for a single
1308
- request; this effectively ignores the host_index
1309
- in the spec for a single request.
1310
- :type _host_index: int, optional
1311
- :return: Returns the result object.
1312
- """ # noqa: E501
1313
-
1314
- _param = self._free_text_relation_extraction_task_update_settings_serialize(
1315
- relation_extraction_task_settings_update_payload=relation_extraction_task_settings_update_payload,
1316
- q_answer_api_key=q_answer_api_key,
1317
- _request_auth=_request_auth,
1318
- _content_type=_content_type,
1319
- _headers=_headers,
1320
- _host_index=_host_index
1321
- )
1322
-
1323
- _response_types_map: Dict[str, Optional[str]] = {
1324
- '200': "RelationExtractionTaskSettings",
1325
- }
1326
- response_data = self.api_client.call_api(
1327
- *_param,
1328
- _request_timeout=_request_timeout
1329
- )
1330
- response_data.read()
1331
- return self.api_client.response_deserialize(
1332
- response_data=response_data,
1333
- response_types_map=_response_types_map,
1334
- ).data
1335
-
1336
-
1337
- @validate_call
1338
- def free_text_relation_extraction_task_update_settings_with_http_info(
1339
- self,
1340
- relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload,
1341
- q_answer_api_key: Optional[StrictStr] = None,
1342
- _request_timeout: Union[
1343
- None,
1344
- Annotated[StrictFloat, Field(gt=0)],
1345
- Tuple[
1346
- Annotated[StrictFloat, Field(gt=0)],
1347
- Annotated[StrictFloat, Field(gt=0)]
1348
- ]
1349
- ] = None,
1350
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1351
- _content_type: Optional[StrictStr] = None,
1352
- _headers: Optional[Dict[StrictStr, Any]] = None,
1353
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1354
- ) -> ApiResponse[RelationExtractionTaskSettings]:
1355
- """This updates the settings of the relation-extraction task
1356
-
1357
-
1358
- :param relation_extraction_task_settings_update_payload: (required)
1359
- :type relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload
1360
- :param q_answer_api_key:
1361
- :type q_answer_api_key: str
1362
- :param _request_timeout: timeout setting for this request. If one
1363
- number provided, it will be total request
1364
- timeout. It can also be a pair (tuple) of
1365
- (connection, read) timeouts.
1366
- :type _request_timeout: int, tuple(int, int), optional
1367
- :param _request_auth: set to override the auth_settings for an a single
1368
- request; this effectively ignores the
1369
- authentication in the spec for a single request.
1370
- :type _request_auth: dict, optional
1371
- :param _content_type: force content-type for the request.
1372
- :type _content_type: str, Optional
1373
- :param _headers: set to override the headers for a single
1374
- request; this effectively ignores the headers
1375
- in the spec for a single request.
1376
- :type _headers: dict, optional
1377
- :param _host_index: set to override the host_index for a single
1378
- request; this effectively ignores the host_index
1379
- in the spec for a single request.
1380
- :type _host_index: int, optional
1381
- :return: Returns the result object.
1382
- """ # noqa: E501
1383
-
1384
- _param = self._free_text_relation_extraction_task_update_settings_serialize(
1385
- relation_extraction_task_settings_update_payload=relation_extraction_task_settings_update_payload,
1386
- q_answer_api_key=q_answer_api_key,
1387
- _request_auth=_request_auth,
1388
- _content_type=_content_type,
1389
- _headers=_headers,
1390
- _host_index=_host_index
1391
- )
1392
-
1393
- _response_types_map: Dict[str, Optional[str]] = {
1394
- '200': "RelationExtractionTaskSettings",
1395
- }
1396
- response_data = self.api_client.call_api(
1397
- *_param,
1398
- _request_timeout=_request_timeout
1399
- )
1400
- response_data.read()
1401
- return self.api_client.response_deserialize(
1402
- response_data=response_data,
1403
- response_types_map=_response_types_map,
1404
- )
1405
-
1406
-
1407
- @validate_call
1408
- def free_text_relation_extraction_task_update_settings_without_preload_content(
1409
- self,
1410
- relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload,
1411
- q_answer_api_key: Optional[StrictStr] = None,
1412
- _request_timeout: Union[
1413
- None,
1414
- Annotated[StrictFloat, Field(gt=0)],
1415
- Tuple[
1416
- Annotated[StrictFloat, Field(gt=0)],
1417
- Annotated[StrictFloat, Field(gt=0)]
1418
- ]
1419
- ] = None,
1420
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1421
- _content_type: Optional[StrictStr] = None,
1422
- _headers: Optional[Dict[StrictStr, Any]] = None,
1423
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1424
- ) -> RESTResponseType:
1425
- """This updates the settings of the relation-extraction task
1426
-
1427
-
1428
- :param relation_extraction_task_settings_update_payload: (required)
1429
- :type relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload
1430
- :param q_answer_api_key:
1431
- :type q_answer_api_key: str
1432
- :param _request_timeout: timeout setting for this request. If one
1433
- number provided, it will be total request
1434
- timeout. It can also be a pair (tuple) of
1435
- (connection, read) timeouts.
1436
- :type _request_timeout: int, tuple(int, int), optional
1437
- :param _request_auth: set to override the auth_settings for an a single
1438
- request; this effectively ignores the
1439
- authentication in the spec for a single request.
1440
- :type _request_auth: dict, optional
1441
- :param _content_type: force content-type for the request.
1442
- :type _content_type: str, Optional
1443
- :param _headers: set to override the headers for a single
1444
- request; this effectively ignores the headers
1445
- in the spec for a single request.
1446
- :type _headers: dict, optional
1447
- :param _host_index: set to override the host_index for a single
1448
- request; this effectively ignores the host_index
1449
- in the spec for a single request.
1450
- :type _host_index: int, optional
1451
- :return: Returns the result object.
1452
- """ # noqa: E501
1453
-
1454
- _param = self._free_text_relation_extraction_task_update_settings_serialize(
1455
- relation_extraction_task_settings_update_payload=relation_extraction_task_settings_update_payload,
1456
- q_answer_api_key=q_answer_api_key,
1457
- _request_auth=_request_auth,
1458
- _content_type=_content_type,
1459
- _headers=_headers,
1460
- _host_index=_host_index
1461
- )
1462
-
1463
- _response_types_map: Dict[str, Optional[str]] = {
1464
- '200': "RelationExtractionTaskSettings",
1465
- }
1466
- response_data = self.api_client.call_api(
1467
- *_param,
1468
- _request_timeout=_request_timeout
1469
- )
1470
- return response_data.response
1471
-
1472
-
1473
- def _free_text_relation_extraction_task_update_settings_serialize(
1474
- self,
1475
- relation_extraction_task_settings_update_payload,
1476
- q_answer_api_key,
1477
- _request_auth,
1478
- _content_type,
1479
- _headers,
1480
- _host_index,
1481
- ) -> RequestSerialized:
1482
-
1483
- _host = None
1484
-
1485
- _collection_formats: Dict[str, str] = {
1486
- }
1487
-
1488
- _path_params: Dict[str, str] = {}
1489
- _query_params: List[Tuple[str, str]] = []
1490
- _header_params: Dict[str, Optional[str]] = _headers or {}
1491
- _form_params: List[Tuple[str, str]] = []
1492
- _files: Dict[
1493
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1494
- ] = {}
1495
- _body_params: Optional[bytes] = None
1496
-
1497
- # process the path parameters
1498
- # process the query parameters
1499
- # process the header parameters
1500
- if q_answer_api_key is not None:
1501
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
1502
- # process the form parameters
1503
- # process the body parameter
1504
- if relation_extraction_task_settings_update_payload is not None:
1505
- _body_params = relation_extraction_task_settings_update_payload
1506
-
1507
-
1508
- # set the HTTP header `Accept`
1509
- if 'Accept' not in _header_params:
1510
- _header_params['Accept'] = self.api_client.select_header_accept(
1511
- [
1512
- '*/*'
1513
- ]
1514
- )
1515
-
1516
- # set the HTTP header `Content-Type`
1517
- if _content_type:
1518
- _header_params['Content-Type'] = _content_type
1519
- else:
1520
- _default_content_type = (
1521
- self.api_client.select_header_content_type(
1522
- [
1523
- 'application/json'
1524
- ]
1525
- )
1526
- )
1527
- if _default_content_type is not None:
1528
- _header_params['Content-Type'] = _default_content_type
1529
-
1530
- # authentication setting
1531
- _auth_settings: List[str] = [
1532
- 'QAnswer-Api-Key',
1533
- 'Bearer'
1534
- ]
1535
-
1536
- return self.api_client.param_serialize(
1537
- method='PUT',
1538
- resource_path='/api/tasks/relation-extraction/settings',
1539
- path_params=_path_params,
1540
- query_params=_query_params,
1541
- header_params=_header_params,
1542
- body=_body_params,
1543
- post_params=_form_params,
1544
- files=_files,
1545
- auth_settings=_auth_settings,
1546
- collection_formats=_collection_formats,
1547
- _host=_host,
1548
- _request_auth=_request_auth
1549
- )
1550
-
1551
-
1552
-
1553
-
1554
- @validate_call
1555
- def free_text_summariser_relation_extraction(
1556
- self,
1557
- relation_extraction_payload: RelationExtractionPayload,
1558
- q_answer_api_key: Optional[StrictStr] = None,
1559
- _request_timeout: Union[
1560
- None,
1561
- Annotated[StrictFloat, Field(gt=0)],
1562
- Tuple[
1563
- Annotated[StrictFloat, Field(gt=0)],
1564
- Annotated[StrictFloat, Field(gt=0)]
1565
- ]
1566
- ] = None,
1567
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1568
- _content_type: Optional[StrictStr] = None,
1569
- _headers: Optional[Dict[StrictStr, Any]] = None,
1570
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1571
- ) -> RelationExtractionDataOutput:
1572
- """Extracts relations over the underlying data
1573
-
1574
-
1575
- :param relation_extraction_payload: (required)
1576
- :type relation_extraction_payload: RelationExtractionPayload
1577
- :param q_answer_api_key:
1578
- :type q_answer_api_key: str
1579
- :param _request_timeout: timeout setting for this request. If one
1580
- number provided, it will be total request
1581
- timeout. It can also be a pair (tuple) of
1582
- (connection, read) timeouts.
1583
- :type _request_timeout: int, tuple(int, int), optional
1584
- :param _request_auth: set to override the auth_settings for an a single
1585
- request; this effectively ignores the
1586
- authentication in the spec for a single request.
1587
- :type _request_auth: dict, optional
1588
- :param _content_type: force content-type for the request.
1589
- :type _content_type: str, Optional
1590
- :param _headers: set to override the headers for a single
1591
- request; this effectively ignores the headers
1592
- in the spec for a single request.
1593
- :type _headers: dict, optional
1594
- :param _host_index: set to override the host_index for a single
1595
- request; this effectively ignores the host_index
1596
- in the spec for a single request.
1597
- :type _host_index: int, optional
1598
- :return: Returns the result object.
1599
- """ # noqa: E501
1600
-
1601
- _param = self._free_text_summariser_relation_extraction_serialize(
1602
- relation_extraction_payload=relation_extraction_payload,
1603
- q_answer_api_key=q_answer_api_key,
1604
- _request_auth=_request_auth,
1605
- _content_type=_content_type,
1606
- _headers=_headers,
1607
- _host_index=_host_index
1608
- )
1609
-
1610
- _response_types_map: Dict[str, Optional[str]] = {
1611
- '200': "RelationExtractionDataOutput",
1612
- }
1613
- response_data = self.api_client.call_api(
1614
- *_param,
1615
- _request_timeout=_request_timeout
1616
- )
1617
- response_data.read()
1618
- return self.api_client.response_deserialize(
1619
- response_data=response_data,
1620
- response_types_map=_response_types_map,
1621
- ).data
1622
-
1623
-
1624
- @validate_call
1625
- def free_text_summariser_relation_extraction_with_http_info(
1626
- self,
1627
- relation_extraction_payload: RelationExtractionPayload,
1628
- q_answer_api_key: Optional[StrictStr] = None,
1629
- _request_timeout: Union[
1630
- None,
1631
- Annotated[StrictFloat, Field(gt=0)],
1632
- Tuple[
1633
- Annotated[StrictFloat, Field(gt=0)],
1634
- Annotated[StrictFloat, Field(gt=0)]
1635
- ]
1636
- ] = None,
1637
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1638
- _content_type: Optional[StrictStr] = None,
1639
- _headers: Optional[Dict[StrictStr, Any]] = None,
1640
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1641
- ) -> ApiResponse[RelationExtractionDataOutput]:
1642
- """Extracts relations over the underlying data
1643
-
1644
-
1645
- :param relation_extraction_payload: (required)
1646
- :type relation_extraction_payload: RelationExtractionPayload
1647
- :param q_answer_api_key:
1648
- :type q_answer_api_key: str
1649
- :param _request_timeout: timeout setting for this request. If one
1650
- number provided, it will be total request
1651
- timeout. It can also be a pair (tuple) of
1652
- (connection, read) timeouts.
1653
- :type _request_timeout: int, tuple(int, int), optional
1654
- :param _request_auth: set to override the auth_settings for an a single
1655
- request; this effectively ignores the
1656
- authentication in the spec for a single request.
1657
- :type _request_auth: dict, optional
1658
- :param _content_type: force content-type for the request.
1659
- :type _content_type: str, Optional
1660
- :param _headers: set to override the headers for a single
1661
- request; this effectively ignores the headers
1662
- in the spec for a single request.
1663
- :type _headers: dict, optional
1664
- :param _host_index: set to override the host_index for a single
1665
- request; this effectively ignores the host_index
1666
- in the spec for a single request.
1667
- :type _host_index: int, optional
1668
- :return: Returns the result object.
1669
- """ # noqa: E501
1670
-
1671
- _param = self._free_text_summariser_relation_extraction_serialize(
1672
- relation_extraction_payload=relation_extraction_payload,
1673
- q_answer_api_key=q_answer_api_key,
1674
- _request_auth=_request_auth,
1675
- _content_type=_content_type,
1676
- _headers=_headers,
1677
- _host_index=_host_index
1678
- )
1679
-
1680
- _response_types_map: Dict[str, Optional[str]] = {
1681
- '200': "RelationExtractionDataOutput",
1682
- }
1683
- response_data = self.api_client.call_api(
1684
- *_param,
1685
- _request_timeout=_request_timeout
1686
- )
1687
- response_data.read()
1688
- return self.api_client.response_deserialize(
1689
- response_data=response_data,
1690
- response_types_map=_response_types_map,
1691
- )
1692
-
1693
-
1694
- @validate_call
1695
- def free_text_summariser_relation_extraction_without_preload_content(
1696
- self,
1697
- relation_extraction_payload: RelationExtractionPayload,
1698
- q_answer_api_key: Optional[StrictStr] = None,
1699
- _request_timeout: Union[
1700
- None,
1701
- Annotated[StrictFloat, Field(gt=0)],
1702
- Tuple[
1703
- Annotated[StrictFloat, Field(gt=0)],
1704
- Annotated[StrictFloat, Field(gt=0)]
1705
- ]
1706
- ] = None,
1707
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1708
- _content_type: Optional[StrictStr] = None,
1709
- _headers: Optional[Dict[StrictStr, Any]] = None,
1710
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1711
- ) -> RESTResponseType:
1712
- """Extracts relations over the underlying data
1713
-
1714
-
1715
- :param relation_extraction_payload: (required)
1716
- :type relation_extraction_payload: RelationExtractionPayload
1717
- :param q_answer_api_key:
1718
- :type q_answer_api_key: str
1719
- :param _request_timeout: timeout setting for this request. If one
1720
- number provided, it will be total request
1721
- timeout. It can also be a pair (tuple) of
1722
- (connection, read) timeouts.
1723
- :type _request_timeout: int, tuple(int, int), optional
1724
- :param _request_auth: set to override the auth_settings for an a single
1725
- request; this effectively ignores the
1726
- authentication in the spec for a single request.
1727
- :type _request_auth: dict, optional
1728
- :param _content_type: force content-type for the request.
1729
- :type _content_type: str, Optional
1730
- :param _headers: set to override the headers for a single
1731
- request; this effectively ignores the headers
1732
- in the spec for a single request.
1733
- :type _headers: dict, optional
1734
- :param _host_index: set to override the host_index for a single
1735
- request; this effectively ignores the host_index
1736
- in the spec for a single request.
1737
- :type _host_index: int, optional
1738
- :return: Returns the result object.
1739
- """ # noqa: E501
1740
-
1741
- _param = self._free_text_summariser_relation_extraction_serialize(
1742
- relation_extraction_payload=relation_extraction_payload,
1743
- q_answer_api_key=q_answer_api_key,
1744
- _request_auth=_request_auth,
1745
- _content_type=_content_type,
1746
- _headers=_headers,
1747
- _host_index=_host_index
1748
- )
1749
-
1750
- _response_types_map: Dict[str, Optional[str]] = {
1751
- '200': "RelationExtractionDataOutput",
1752
- }
1753
- response_data = self.api_client.call_api(
1754
- *_param,
1755
- _request_timeout=_request_timeout
1756
- )
1757
- return response_data.response
1758
-
1759
-
1760
- def _free_text_summariser_relation_extraction_serialize(
1761
- self,
1762
- relation_extraction_payload,
1763
- q_answer_api_key,
1764
- _request_auth,
1765
- _content_type,
1766
- _headers,
1767
- _host_index,
1768
- ) -> RequestSerialized:
1769
-
1770
- _host = None
1771
-
1772
- _collection_formats: Dict[str, str] = {
1773
- }
1774
-
1775
- _path_params: Dict[str, str] = {}
1776
- _query_params: List[Tuple[str, str]] = []
1777
- _header_params: Dict[str, Optional[str]] = _headers or {}
1778
- _form_params: List[Tuple[str, str]] = []
1779
- _files: Dict[
1780
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1781
- ] = {}
1782
- _body_params: Optional[bytes] = None
1783
-
1784
- # process the path parameters
1785
- # process the query parameters
1786
- # process the header parameters
1787
- if q_answer_api_key is not None:
1788
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
1789
- # process the form parameters
1790
- # process the body parameter
1791
- if relation_extraction_payload is not None:
1792
- _body_params = relation_extraction_payload
1793
-
1794
-
1795
- # set the HTTP header `Accept`
1796
- if 'Accept' not in _header_params:
1797
- _header_params['Accept'] = self.api_client.select_header_accept(
1798
- [
1799
- '*/*'
1800
- ]
1801
- )
1802
-
1803
- # set the HTTP header `Content-Type`
1804
- if _content_type:
1805
- _header_params['Content-Type'] = _content_type
1806
- else:
1807
- _default_content_type = (
1808
- self.api_client.select_header_content_type(
1809
- [
1810
- 'application/json'
1811
- ]
1812
- )
1813
- )
1814
- if _default_content_type is not None:
1815
- _header_params['Content-Type'] = _default_content_type
1816
-
1817
- # authentication setting
1818
- _auth_settings: List[str] = [
1819
- 'QAnswer-Api-Key',
1820
- 'Bearer'
1821
- ]
1822
-
1823
- return self.api_client.param_serialize(
1824
- method='POST',
1825
- resource_path='/api/tasks/relation-extraction',
1826
- path_params=_path_params,
1827
- query_params=_query_params,
1828
- header_params=_header_params,
1829
- body=_body_params,
1830
- post_params=_form_params,
1831
- files=_files,
1832
- auth_settings=_auth_settings,
1833
- collection_formats=_collection_formats,
1834
- _host=_host,
1835
- _request_auth=_request_auth
1836
- )
1837
-
1838
-
1839
-
1840
-
1841
- @validate_call
1842
- def free_text_summariser_relation_extraction_export_schema(
1843
- self,
1844
- relation_extraction_configuration: RelationExtractionConfiguration,
1845
- q_answer_api_key: Optional[StrictStr] = None,
1846
- _request_timeout: Union[
1847
- None,
1848
- Annotated[StrictFloat, Field(gt=0)],
1849
- Tuple[
1850
- Annotated[StrictFloat, Field(gt=0)],
1851
- Annotated[StrictFloat, Field(gt=0)]
1852
- ]
1853
- ] = None,
1854
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1855
- _content_type: Optional[StrictStr] = None,
1856
- _headers: Optional[Dict[StrictStr, Any]] = None,
1857
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1858
- ) -> bytearray:
1859
- """Exports the schema for relation extraction
1860
-
1861
-
1862
- :param relation_extraction_configuration: (required)
1863
- :type relation_extraction_configuration: RelationExtractionConfiguration
1864
- :param q_answer_api_key:
1865
- :type q_answer_api_key: str
1866
- :param _request_timeout: timeout setting for this request. If one
1867
- number provided, it will be total request
1868
- timeout. It can also be a pair (tuple) of
1869
- (connection, read) timeouts.
1870
- :type _request_timeout: int, tuple(int, int), optional
1871
- :param _request_auth: set to override the auth_settings for an a single
1872
- request; this effectively ignores the
1873
- authentication in the spec for a single request.
1874
- :type _request_auth: dict, optional
1875
- :param _content_type: force content-type for the request.
1876
- :type _content_type: str, Optional
1877
- :param _headers: set to override the headers for a single
1878
- request; this effectively ignores the headers
1879
- in the spec for a single request.
1880
- :type _headers: dict, optional
1881
- :param _host_index: set to override the host_index for a single
1882
- request; this effectively ignores the host_index
1883
- in the spec for a single request.
1884
- :type _host_index: int, optional
1885
- :return: Returns the result object.
1886
- """ # noqa: E501
1887
-
1888
- _param = self._free_text_summariser_relation_extraction_export_schema_serialize(
1889
- relation_extraction_configuration=relation_extraction_configuration,
1890
- q_answer_api_key=q_answer_api_key,
1891
- _request_auth=_request_auth,
1892
- _content_type=_content_type,
1893
- _headers=_headers,
1894
- _host_index=_host_index
1895
- )
1896
-
1897
- _response_types_map: Dict[str, Optional[str]] = {
1898
- '200': "bytearray",
1899
- }
1900
- response_data = self.api_client.call_api(
1901
- *_param,
1902
- _request_timeout=_request_timeout
1903
- )
1904
- response_data.read()
1905
- return self.api_client.response_deserialize(
1906
- response_data=response_data,
1907
- response_types_map=_response_types_map,
1908
- ).data
1909
-
1910
-
1911
- @validate_call
1912
- def free_text_summariser_relation_extraction_export_schema_with_http_info(
1913
- self,
1914
- relation_extraction_configuration: RelationExtractionConfiguration,
1915
- q_answer_api_key: Optional[StrictStr] = None,
1916
- _request_timeout: Union[
1917
- None,
1918
- Annotated[StrictFloat, Field(gt=0)],
1919
- Tuple[
1920
- Annotated[StrictFloat, Field(gt=0)],
1921
- Annotated[StrictFloat, Field(gt=0)]
1922
- ]
1923
- ] = None,
1924
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1925
- _content_type: Optional[StrictStr] = None,
1926
- _headers: Optional[Dict[StrictStr, Any]] = None,
1927
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1928
- ) -> ApiResponse[bytearray]:
1929
- """Exports the schema for relation extraction
1930
-
1931
-
1932
- :param relation_extraction_configuration: (required)
1933
- :type relation_extraction_configuration: RelationExtractionConfiguration
1934
- :param q_answer_api_key:
1935
- :type q_answer_api_key: str
1936
- :param _request_timeout: timeout setting for this request. If one
1937
- number provided, it will be total request
1938
- timeout. It can also be a pair (tuple) of
1939
- (connection, read) timeouts.
1940
- :type _request_timeout: int, tuple(int, int), optional
1941
- :param _request_auth: set to override the auth_settings for an a single
1942
- request; this effectively ignores the
1943
- authentication in the spec for a single request.
1944
- :type _request_auth: dict, optional
1945
- :param _content_type: force content-type for the request.
1946
- :type _content_type: str, Optional
1947
- :param _headers: set to override the headers for a single
1948
- request; this effectively ignores the headers
1949
- in the spec for a single request.
1950
- :type _headers: dict, optional
1951
- :param _host_index: set to override the host_index for a single
1952
- request; this effectively ignores the host_index
1953
- in the spec for a single request.
1954
- :type _host_index: int, optional
1955
- :return: Returns the result object.
1956
- """ # noqa: E501
1957
-
1958
- _param = self._free_text_summariser_relation_extraction_export_schema_serialize(
1959
- relation_extraction_configuration=relation_extraction_configuration,
1960
- q_answer_api_key=q_answer_api_key,
1961
- _request_auth=_request_auth,
1962
- _content_type=_content_type,
1963
- _headers=_headers,
1964
- _host_index=_host_index
1965
- )
1966
-
1967
- _response_types_map: Dict[str, Optional[str]] = {
1968
- '200': "bytearray",
1969
- }
1970
- response_data = self.api_client.call_api(
1971
- *_param,
1972
- _request_timeout=_request_timeout
1973
- )
1974
- response_data.read()
1975
- return self.api_client.response_deserialize(
1976
- response_data=response_data,
1977
- response_types_map=_response_types_map,
1978
- )
1979
-
1980
-
1981
- @validate_call
1982
- def free_text_summariser_relation_extraction_export_schema_without_preload_content(
1983
- self,
1984
- relation_extraction_configuration: RelationExtractionConfiguration,
1985
- q_answer_api_key: Optional[StrictStr] = None,
1986
- _request_timeout: Union[
1987
- None,
1988
- Annotated[StrictFloat, Field(gt=0)],
1989
- Tuple[
1990
- Annotated[StrictFloat, Field(gt=0)],
1991
- Annotated[StrictFloat, Field(gt=0)]
1992
- ]
1993
- ] = None,
1994
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1995
- _content_type: Optional[StrictStr] = None,
1996
- _headers: Optional[Dict[StrictStr, Any]] = None,
1997
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1998
- ) -> RESTResponseType:
1999
- """Exports the schema for relation extraction
2000
-
2001
-
2002
- :param relation_extraction_configuration: (required)
2003
- :type relation_extraction_configuration: RelationExtractionConfiguration
2004
- :param q_answer_api_key:
2005
- :type q_answer_api_key: str
2006
- :param _request_timeout: timeout setting for this request. If one
2007
- number provided, it will be total request
2008
- timeout. It can also be a pair (tuple) of
2009
- (connection, read) timeouts.
2010
- :type _request_timeout: int, tuple(int, int), optional
2011
- :param _request_auth: set to override the auth_settings for an a single
2012
- request; this effectively ignores the
2013
- authentication in the spec for a single request.
2014
- :type _request_auth: dict, optional
2015
- :param _content_type: force content-type for the request.
2016
- :type _content_type: str, Optional
2017
- :param _headers: set to override the headers for a single
2018
- request; this effectively ignores the headers
2019
- in the spec for a single request.
2020
- :type _headers: dict, optional
2021
- :param _host_index: set to override the host_index for a single
2022
- request; this effectively ignores the host_index
2023
- in the spec for a single request.
2024
- :type _host_index: int, optional
2025
- :return: Returns the result object.
2026
- """ # noqa: E501
2027
-
2028
- _param = self._free_text_summariser_relation_extraction_export_schema_serialize(
2029
- relation_extraction_configuration=relation_extraction_configuration,
2030
- q_answer_api_key=q_answer_api_key,
2031
- _request_auth=_request_auth,
2032
- _content_type=_content_type,
2033
- _headers=_headers,
2034
- _host_index=_host_index
2035
- )
2036
-
2037
- _response_types_map: Dict[str, Optional[str]] = {
2038
- '200': "bytearray",
2039
- }
2040
- response_data = self.api_client.call_api(
2041
- *_param,
2042
- _request_timeout=_request_timeout
2043
- )
2044
- return response_data.response
2045
-
2046
-
2047
- def _free_text_summariser_relation_extraction_export_schema_serialize(
2048
- self,
2049
- relation_extraction_configuration,
2050
- q_answer_api_key,
2051
- _request_auth,
2052
- _content_type,
2053
- _headers,
2054
- _host_index,
2055
- ) -> RequestSerialized:
2056
-
2057
- _host = None
2058
-
2059
- _collection_formats: Dict[str, str] = {
2060
- }
2061
-
2062
- _path_params: Dict[str, str] = {}
2063
- _query_params: List[Tuple[str, str]] = []
2064
- _header_params: Dict[str, Optional[str]] = _headers or {}
2065
- _form_params: List[Tuple[str, str]] = []
2066
- _files: Dict[
2067
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2068
- ] = {}
2069
- _body_params: Optional[bytes] = None
2070
-
2071
- # process the path parameters
2072
- # process the query parameters
2073
- # process the header parameters
2074
- if q_answer_api_key is not None:
2075
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
2076
- # process the form parameters
2077
- # process the body parameter
2078
- if relation_extraction_configuration is not None:
2079
- _body_params = relation_extraction_configuration
2080
-
2081
-
2082
- # set the HTTP header `Accept`
2083
- if 'Accept' not in _header_params:
2084
- _header_params['Accept'] = self.api_client.select_header_accept(
2085
- [
2086
- '*/*'
2087
- ]
2088
- )
2089
-
2090
- # set the HTTP header `Content-Type`
2091
- if _content_type:
2092
- _header_params['Content-Type'] = _content_type
2093
- else:
2094
- _default_content_type = (
2095
- self.api_client.select_header_content_type(
2096
- [
2097
- 'application/json'
2098
- ]
2099
- )
2100
- )
2101
- if _default_content_type is not None:
2102
- _header_params['Content-Type'] = _default_content_type
2103
-
2104
- # authentication setting
2105
- _auth_settings: List[str] = [
2106
- 'QAnswer-Api-Key',
2107
- 'Bearer'
2108
- ]
2109
-
2110
- return self.api_client.param_serialize(
2111
- method='POST',
2112
- resource_path='/api/tasks/relation-extraction/export-schema',
2113
- path_params=_path_params,
2114
- query_params=_query_params,
2115
- header_params=_header_params,
2116
- body=_body_params,
2117
- post_params=_form_params,
2118
- files=_files,
2119
- auth_settings=_auth_settings,
2120
- collection_formats=_collection_formats,
2121
- _host=_host,
2122
- _request_auth=_request_auth
2123
- )
2124
-
2125
-
2126
-
2127
-
2128
- @validate_call
2129
- def free_text_summariser_relation_extraction_import_schema(
2130
- self,
2131
- file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
2132
- q_answer_api_key: Optional[StrictStr] = None,
2133
- _request_timeout: Union[
2134
- None,
2135
- Annotated[StrictFloat, Field(gt=0)],
2136
- Tuple[
2137
- Annotated[StrictFloat, Field(gt=0)],
2138
- Annotated[StrictFloat, Field(gt=0)]
2139
- ]
2140
- ] = None,
2141
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2142
- _content_type: Optional[StrictStr] = None,
2143
- _headers: Optional[Dict[StrictStr, Any]] = None,
2144
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2145
- ) -> RelationExtractionConfiguration:
2146
- """Exports the schema for relation extraction
2147
-
2148
-
2149
- :param file: (required)
2150
- :type file: bytearray
2151
- :param q_answer_api_key:
2152
- :type q_answer_api_key: str
2153
- :param _request_timeout: timeout setting for this request. If one
2154
- number provided, it will be total request
2155
- timeout. It can also be a pair (tuple) of
2156
- (connection, read) timeouts.
2157
- :type _request_timeout: int, tuple(int, int), optional
2158
- :param _request_auth: set to override the auth_settings for an a single
2159
- request; this effectively ignores the
2160
- authentication in the spec for a single request.
2161
- :type _request_auth: dict, optional
2162
- :param _content_type: force content-type for the request.
2163
- :type _content_type: str, Optional
2164
- :param _headers: set to override the headers for a single
2165
- request; this effectively ignores the headers
2166
- in the spec for a single request.
2167
- :type _headers: dict, optional
2168
- :param _host_index: set to override the host_index for a single
2169
- request; this effectively ignores the host_index
2170
- in the spec for a single request.
2171
- :type _host_index: int, optional
2172
- :return: Returns the result object.
2173
- """ # noqa: E501
2174
-
2175
- _param = self._free_text_summariser_relation_extraction_import_schema_serialize(
2176
- file=file,
2177
- q_answer_api_key=q_answer_api_key,
2178
- _request_auth=_request_auth,
2179
- _content_type=_content_type,
2180
- _headers=_headers,
2181
- _host_index=_host_index
2182
- )
2183
-
2184
- _response_types_map: Dict[str, Optional[str]] = {
2185
- '200': "RelationExtractionConfiguration",
2186
- }
2187
- response_data = self.api_client.call_api(
2188
- *_param,
2189
- _request_timeout=_request_timeout
2190
- )
2191
- response_data.read()
2192
- return self.api_client.response_deserialize(
2193
- response_data=response_data,
2194
- response_types_map=_response_types_map,
2195
- ).data
2196
-
2197
-
2198
- @validate_call
2199
- def free_text_summariser_relation_extraction_import_schema_with_http_info(
2200
- self,
2201
- file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
2202
- q_answer_api_key: Optional[StrictStr] = None,
2203
- _request_timeout: Union[
2204
- None,
2205
- Annotated[StrictFloat, Field(gt=0)],
2206
- Tuple[
2207
- Annotated[StrictFloat, Field(gt=0)],
2208
- Annotated[StrictFloat, Field(gt=0)]
2209
- ]
2210
- ] = None,
2211
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2212
- _content_type: Optional[StrictStr] = None,
2213
- _headers: Optional[Dict[StrictStr, Any]] = None,
2214
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2215
- ) -> ApiResponse[RelationExtractionConfiguration]:
2216
- """Exports the schema for relation extraction
2217
-
2218
-
2219
- :param file: (required)
2220
- :type file: bytearray
2221
- :param q_answer_api_key:
2222
- :type q_answer_api_key: str
2223
- :param _request_timeout: timeout setting for this request. If one
2224
- number provided, it will be total request
2225
- timeout. It can also be a pair (tuple) of
2226
- (connection, read) timeouts.
2227
- :type _request_timeout: int, tuple(int, int), optional
2228
- :param _request_auth: set to override the auth_settings for an a single
2229
- request; this effectively ignores the
2230
- authentication in the spec for a single request.
2231
- :type _request_auth: dict, optional
2232
- :param _content_type: force content-type for the request.
2233
- :type _content_type: str, Optional
2234
- :param _headers: set to override the headers for a single
2235
- request; this effectively ignores the headers
2236
- in the spec for a single request.
2237
- :type _headers: dict, optional
2238
- :param _host_index: set to override the host_index for a single
2239
- request; this effectively ignores the host_index
2240
- in the spec for a single request.
2241
- :type _host_index: int, optional
2242
- :return: Returns the result object.
2243
- """ # noqa: E501
2244
-
2245
- _param = self._free_text_summariser_relation_extraction_import_schema_serialize(
2246
- file=file,
2247
- q_answer_api_key=q_answer_api_key,
2248
- _request_auth=_request_auth,
2249
- _content_type=_content_type,
2250
- _headers=_headers,
2251
- _host_index=_host_index
2252
- )
2253
-
2254
- _response_types_map: Dict[str, Optional[str]] = {
2255
- '200': "RelationExtractionConfiguration",
2256
- }
2257
- response_data = self.api_client.call_api(
2258
- *_param,
2259
- _request_timeout=_request_timeout
2260
- )
2261
- response_data.read()
2262
- return self.api_client.response_deserialize(
2263
- response_data=response_data,
2264
- response_types_map=_response_types_map,
2265
- )
2266
-
2267
-
2268
- @validate_call
2269
- def free_text_summariser_relation_extraction_import_schema_without_preload_content(
2270
- self,
2271
- file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
2272
- q_answer_api_key: Optional[StrictStr] = None,
2273
- _request_timeout: Union[
2274
- None,
2275
- Annotated[StrictFloat, Field(gt=0)],
2276
- Tuple[
2277
- Annotated[StrictFloat, Field(gt=0)],
2278
- Annotated[StrictFloat, Field(gt=0)]
2279
- ]
2280
- ] = None,
2281
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2282
- _content_type: Optional[StrictStr] = None,
2283
- _headers: Optional[Dict[StrictStr, Any]] = None,
2284
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2285
- ) -> RESTResponseType:
2286
- """Exports the schema for relation extraction
2287
-
2288
-
2289
- :param file: (required)
2290
- :type file: bytearray
2291
- :param q_answer_api_key:
2292
- :type q_answer_api_key: str
2293
- :param _request_timeout: timeout setting for this request. If one
2294
- number provided, it will be total request
2295
- timeout. It can also be a pair (tuple) of
2296
- (connection, read) timeouts.
2297
- :type _request_timeout: int, tuple(int, int), optional
2298
- :param _request_auth: set to override the auth_settings for an a single
2299
- request; this effectively ignores the
2300
- authentication in the spec for a single request.
2301
- :type _request_auth: dict, optional
2302
- :param _content_type: force content-type for the request.
2303
- :type _content_type: str, Optional
2304
- :param _headers: set to override the headers for a single
2305
- request; this effectively ignores the headers
2306
- in the spec for a single request.
2307
- :type _headers: dict, optional
2308
- :param _host_index: set to override the host_index for a single
2309
- request; this effectively ignores the host_index
2310
- in the spec for a single request.
2311
- :type _host_index: int, optional
2312
- :return: Returns the result object.
2313
- """ # noqa: E501
2314
-
2315
- _param = self._free_text_summariser_relation_extraction_import_schema_serialize(
2316
- file=file,
2317
- q_answer_api_key=q_answer_api_key,
2318
- _request_auth=_request_auth,
2319
- _content_type=_content_type,
2320
- _headers=_headers,
2321
- _host_index=_host_index
2322
- )
2323
-
2324
- _response_types_map: Dict[str, Optional[str]] = {
2325
- '200': "RelationExtractionConfiguration",
2326
- }
2327
- response_data = self.api_client.call_api(
2328
- *_param,
2329
- _request_timeout=_request_timeout
2330
- )
2331
- return response_data.response
2332
-
2333
-
2334
- def _free_text_summariser_relation_extraction_import_schema_serialize(
2335
- self,
2336
- file,
2337
- q_answer_api_key,
2338
- _request_auth,
2339
- _content_type,
2340
- _headers,
2341
- _host_index,
2342
- ) -> RequestSerialized:
2343
-
2344
- _host = None
2345
-
2346
- _collection_formats: Dict[str, str] = {
2347
- }
2348
-
2349
- _path_params: Dict[str, str] = {}
2350
- _query_params: List[Tuple[str, str]] = []
2351
- _header_params: Dict[str, Optional[str]] = _headers or {}
2352
- _form_params: List[Tuple[str, str]] = []
2353
- _files: Dict[
2354
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2355
- ] = {}
2356
- _body_params: Optional[bytes] = None
2357
-
2358
- # process the path parameters
2359
- # process the query parameters
2360
- # process the header parameters
2361
- if q_answer_api_key is not None:
2362
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
2363
- # process the form parameters
2364
- if file is not None:
2365
- _files['file'] = file
2366
- # process the body parameter
2367
-
2368
-
2369
- # set the HTTP header `Accept`
2370
- if 'Accept' not in _header_params:
2371
- _header_params['Accept'] = self.api_client.select_header_accept(
2372
- [
2373
- '*/*'
2374
- ]
2375
- )
2376
-
2377
- # set the HTTP header `Content-Type`
2378
- if _content_type:
2379
- _header_params['Content-Type'] = _content_type
2380
- else:
2381
- _default_content_type = (
2382
- self.api_client.select_header_content_type(
2383
- [
2384
- 'multipart/form-data'
2385
- ]
2386
- )
2387
- )
2388
- if _default_content_type is not None:
2389
- _header_params['Content-Type'] = _default_content_type
2390
-
2391
- # authentication setting
2392
- _auth_settings: List[str] = [
2393
- 'QAnswer-Api-Key',
2394
- 'Bearer'
2395
- ]
2396
-
2397
- return self.api_client.param_serialize(
2398
- method='POST',
2399
- resource_path='/api/tasks/relation-extraction/import-schema',
2400
- path_params=_path_params,
2401
- query_params=_query_params,
2402
- header_params=_header_params,
2403
- body=_body_params,
2404
- post_params=_form_params,
2405
- files=_files,
2406
- auth_settings=_auth_settings,
2407
- collection_formats=_collection_formats,
2408
- _host=_host,
2409
- _request_auth=_request_auth
2410
- )
2411
-
2412
-
2413
-
2414
-
2415
- @validate_call
2416
- def get_relation_extraction_template(
2417
- self,
2418
- username: StrictStr,
2419
- dataset: StrictStr,
2420
- template_id: StrictInt,
2421
- q_answer_api_key: Optional[StrictStr] = None,
2422
- _request_timeout: Union[
2423
- None,
2424
- Annotated[StrictFloat, Field(gt=0)],
2425
- Tuple[
2426
- Annotated[StrictFloat, Field(gt=0)],
2427
- Annotated[StrictFloat, Field(gt=0)]
2428
- ]
2429
- ] = None,
2430
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2431
- _content_type: Optional[StrictStr] = None,
2432
- _headers: Optional[Dict[StrictStr, Any]] = None,
2433
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2434
- ) -> RelationExtractionSchema:
2435
- """Get a specific relation extraction template
2436
-
2437
-
2438
- :param username: (required)
2439
- :type username: str
2440
- :param dataset: (required)
2441
- :type dataset: str
2442
- :param template_id: (required)
2443
- :type template_id: int
2444
- :param q_answer_api_key:
2445
- :type q_answer_api_key: str
2446
- :param _request_timeout: timeout setting for this request. If one
2447
- number provided, it will be total request
2448
- timeout. It can also be a pair (tuple) of
2449
- (connection, read) timeouts.
2450
- :type _request_timeout: int, tuple(int, int), optional
2451
- :param _request_auth: set to override the auth_settings for an a single
2452
- request; this effectively ignores the
2453
- authentication in the spec for a single request.
2454
- :type _request_auth: dict, optional
2455
- :param _content_type: force content-type for the request.
2456
- :type _content_type: str, Optional
2457
- :param _headers: set to override the headers for a single
2458
- request; this effectively ignores the headers
2459
- in the spec for a single request.
2460
- :type _headers: dict, optional
2461
- :param _host_index: set to override the host_index for a single
2462
- request; this effectively ignores the host_index
2463
- in the spec for a single request.
2464
- :type _host_index: int, optional
2465
- :return: Returns the result object.
2466
- """ # noqa: E501
2467
-
2468
- _param = self._get_relation_extraction_template_serialize(
2469
- username=username,
2470
- dataset=dataset,
2471
- template_id=template_id,
2472
- q_answer_api_key=q_answer_api_key,
2473
- _request_auth=_request_auth,
2474
- _content_type=_content_type,
2475
- _headers=_headers,
2476
- _host_index=_host_index
2477
- )
2478
-
2479
- _response_types_map: Dict[str, Optional[str]] = {
2480
- '200': "RelationExtractionSchema",
2481
- }
2482
- response_data = self.api_client.call_api(
2483
- *_param,
2484
- _request_timeout=_request_timeout
2485
- )
2486
- response_data.read()
2487
- return self.api_client.response_deserialize(
2488
- response_data=response_data,
2489
- response_types_map=_response_types_map,
2490
- ).data
2491
-
2492
-
2493
- @validate_call
2494
- def get_relation_extraction_template_with_http_info(
2495
- self,
2496
- username: StrictStr,
2497
- dataset: StrictStr,
2498
- template_id: StrictInt,
2499
- q_answer_api_key: Optional[StrictStr] = None,
2500
- _request_timeout: Union[
2501
- None,
2502
- Annotated[StrictFloat, Field(gt=0)],
2503
- Tuple[
2504
- Annotated[StrictFloat, Field(gt=0)],
2505
- Annotated[StrictFloat, Field(gt=0)]
2506
- ]
2507
- ] = None,
2508
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2509
- _content_type: Optional[StrictStr] = None,
2510
- _headers: Optional[Dict[StrictStr, Any]] = None,
2511
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2512
- ) -> ApiResponse[RelationExtractionSchema]:
2513
- """Get a specific relation extraction template
2514
-
2515
-
2516
- :param username: (required)
2517
- :type username: str
2518
- :param dataset: (required)
2519
- :type dataset: str
2520
- :param template_id: (required)
2521
- :type template_id: int
2522
- :param q_answer_api_key:
2523
- :type q_answer_api_key: str
2524
- :param _request_timeout: timeout setting for this request. If one
2525
- number provided, it will be total request
2526
- timeout. It can also be a pair (tuple) of
2527
- (connection, read) timeouts.
2528
- :type _request_timeout: int, tuple(int, int), optional
2529
- :param _request_auth: set to override the auth_settings for an a single
2530
- request; this effectively ignores the
2531
- authentication in the spec for a single request.
2532
- :type _request_auth: dict, optional
2533
- :param _content_type: force content-type for the request.
2534
- :type _content_type: str, Optional
2535
- :param _headers: set to override the headers for a single
2536
- request; this effectively ignores the headers
2537
- in the spec for a single request.
2538
- :type _headers: dict, optional
2539
- :param _host_index: set to override the host_index for a single
2540
- request; this effectively ignores the host_index
2541
- in the spec for a single request.
2542
- :type _host_index: int, optional
2543
- :return: Returns the result object.
2544
- """ # noqa: E501
2545
-
2546
- _param = self._get_relation_extraction_template_serialize(
2547
- username=username,
2548
- dataset=dataset,
2549
- template_id=template_id,
2550
- q_answer_api_key=q_answer_api_key,
2551
- _request_auth=_request_auth,
2552
- _content_type=_content_type,
2553
- _headers=_headers,
2554
- _host_index=_host_index
2555
- )
2556
-
2557
- _response_types_map: Dict[str, Optional[str]] = {
2558
- '200': "RelationExtractionSchema",
2559
- }
2560
- response_data = self.api_client.call_api(
2561
- *_param,
2562
- _request_timeout=_request_timeout
2563
- )
2564
- response_data.read()
2565
- return self.api_client.response_deserialize(
2566
- response_data=response_data,
2567
- response_types_map=_response_types_map,
2568
- )
2569
-
2570
-
2571
- @validate_call
2572
- def get_relation_extraction_template_without_preload_content(
2573
- self,
2574
- username: StrictStr,
2575
- dataset: StrictStr,
2576
- template_id: StrictInt,
2577
- q_answer_api_key: Optional[StrictStr] = None,
2578
- _request_timeout: Union[
2579
- None,
2580
- Annotated[StrictFloat, Field(gt=0)],
2581
- Tuple[
2582
- Annotated[StrictFloat, Field(gt=0)],
2583
- Annotated[StrictFloat, Field(gt=0)]
2584
- ]
2585
- ] = None,
2586
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2587
- _content_type: Optional[StrictStr] = None,
2588
- _headers: Optional[Dict[StrictStr, Any]] = None,
2589
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2590
- ) -> RESTResponseType:
2591
- """Get a specific relation extraction template
2592
-
2593
-
2594
- :param username: (required)
2595
- :type username: str
2596
- :param dataset: (required)
2597
- :type dataset: str
2598
- :param template_id: (required)
2599
- :type template_id: int
2600
- :param q_answer_api_key:
2601
- :type q_answer_api_key: str
2602
- :param _request_timeout: timeout setting for this request. If one
2603
- number provided, it will be total request
2604
- timeout. It can also be a pair (tuple) of
2605
- (connection, read) timeouts.
2606
- :type _request_timeout: int, tuple(int, int), optional
2607
- :param _request_auth: set to override the auth_settings for an a single
2608
- request; this effectively ignores the
2609
- authentication in the spec for a single request.
2610
- :type _request_auth: dict, optional
2611
- :param _content_type: force content-type for the request.
2612
- :type _content_type: str, Optional
2613
- :param _headers: set to override the headers for a single
2614
- request; this effectively ignores the headers
2615
- in the spec for a single request.
2616
- :type _headers: dict, optional
2617
- :param _host_index: set to override the host_index for a single
2618
- request; this effectively ignores the host_index
2619
- in the spec for a single request.
2620
- :type _host_index: int, optional
2621
- :return: Returns the result object.
2622
- """ # noqa: E501
2623
-
2624
- _param = self._get_relation_extraction_template_serialize(
2625
- username=username,
2626
- dataset=dataset,
2627
- template_id=template_id,
2628
- q_answer_api_key=q_answer_api_key,
2629
- _request_auth=_request_auth,
2630
- _content_type=_content_type,
2631
- _headers=_headers,
2632
- _host_index=_host_index
2633
- )
2634
-
2635
- _response_types_map: Dict[str, Optional[str]] = {
2636
- '200': "RelationExtractionSchema",
2637
- }
2638
- response_data = self.api_client.call_api(
2639
- *_param,
2640
- _request_timeout=_request_timeout
2641
- )
2642
- return response_data.response
2643
-
2644
-
2645
- def _get_relation_extraction_template_serialize(
2646
- self,
2647
- username,
2648
- dataset,
2649
- template_id,
2650
- q_answer_api_key,
2651
- _request_auth,
2652
- _content_type,
2653
- _headers,
2654
- _host_index,
2655
- ) -> RequestSerialized:
2656
-
2657
- _host = None
2658
-
2659
- _collection_formats: Dict[str, str] = {
2660
- }
2661
-
2662
- _path_params: Dict[str, str] = {}
2663
- _query_params: List[Tuple[str, str]] = []
2664
- _header_params: Dict[str, Optional[str]] = _headers or {}
2665
- _form_params: List[Tuple[str, str]] = []
2666
- _files: Dict[
2667
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2668
- ] = {}
2669
- _body_params: Optional[bytes] = None
2670
-
2671
- # process the path parameters
2672
- if template_id is not None:
2673
- _path_params['templateId'] = template_id
2674
- # process the query parameters
2675
- if username is not None:
2676
-
2677
- _query_params.append(('username', username))
2678
-
2679
- if dataset is not None:
2680
-
2681
- _query_params.append(('dataset', dataset))
2682
-
2683
- # process the header parameters
2684
- if q_answer_api_key is not None:
2685
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
2686
- # process the form parameters
2687
- # process the body parameter
2688
-
2689
-
2690
- # set the HTTP header `Accept`
2691
- if 'Accept' not in _header_params:
2692
- _header_params['Accept'] = self.api_client.select_header_accept(
2693
- [
2694
- '*/*'
2695
- ]
2696
- )
2697
-
2698
-
2699
- # authentication setting
2700
- _auth_settings: List[str] = [
2701
- 'QAnswer-Api-Key',
2702
- 'Bearer'
2703
- ]
2704
-
2705
- return self.api_client.param_serialize(
2706
- method='GET',
2707
- resource_path='/api/tasks/relation-extraction/templates/{templateId}',
2708
- path_params=_path_params,
2709
- query_params=_query_params,
2710
- header_params=_header_params,
2711
- body=_body_params,
2712
- post_params=_form_params,
2713
- files=_files,
2714
- auth_settings=_auth_settings,
2715
- collection_formats=_collection_formats,
2716
- _host=_host,
2717
- _request_auth=_request_auth
2718
- )
2719
-
2720
-
2721
-
2722
-
2723
- @validate_call
2724
- def list_relation_extraction_templates(
2725
- self,
2726
- username: StrictStr,
2727
- dataset: StrictStr,
2728
- q_answer_api_key: Optional[StrictStr] = None,
2729
- _request_timeout: Union[
2730
- None,
2731
- Annotated[StrictFloat, Field(gt=0)],
2732
- Tuple[
2733
- Annotated[StrictFloat, Field(gt=0)],
2734
- Annotated[StrictFloat, Field(gt=0)]
2735
- ]
2736
- ] = None,
2737
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2738
- _content_type: Optional[StrictStr] = None,
2739
- _headers: Optional[Dict[StrictStr, Any]] = None,
2740
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2741
- ) -> List[RelationExtractionSchema]:
2742
- """List all relation extraction templates
2743
-
2744
-
2745
- :param username: (required)
2746
- :type username: str
2747
- :param dataset: (required)
2748
- :type dataset: str
2749
- :param q_answer_api_key:
2750
- :type q_answer_api_key: str
2751
- :param _request_timeout: timeout setting for this request. If one
2752
- number provided, it will be total request
2753
- timeout. It can also be a pair (tuple) of
2754
- (connection, read) timeouts.
2755
- :type _request_timeout: int, tuple(int, int), optional
2756
- :param _request_auth: set to override the auth_settings for an a single
2757
- request; this effectively ignores the
2758
- authentication in the spec for a single request.
2759
- :type _request_auth: dict, optional
2760
- :param _content_type: force content-type for the request.
2761
- :type _content_type: str, Optional
2762
- :param _headers: set to override the headers for a single
2763
- request; this effectively ignores the headers
2764
- in the spec for a single request.
2765
- :type _headers: dict, optional
2766
- :param _host_index: set to override the host_index for a single
2767
- request; this effectively ignores the host_index
2768
- in the spec for a single request.
2769
- :type _host_index: int, optional
2770
- :return: Returns the result object.
2771
- """ # noqa: E501
2772
-
2773
- _param = self._list_relation_extraction_templates_serialize(
2774
- username=username,
2775
- dataset=dataset,
2776
- q_answer_api_key=q_answer_api_key,
2777
- _request_auth=_request_auth,
2778
- _content_type=_content_type,
2779
- _headers=_headers,
2780
- _host_index=_host_index
2781
- )
2782
-
2783
- _response_types_map: Dict[str, Optional[str]] = {
2784
- '200': "List[RelationExtractionSchema]",
2785
- }
2786
- response_data = self.api_client.call_api(
2787
- *_param,
2788
- _request_timeout=_request_timeout
2789
- )
2790
- response_data.read()
2791
- return self.api_client.response_deserialize(
2792
- response_data=response_data,
2793
- response_types_map=_response_types_map,
2794
- ).data
2795
-
2796
-
2797
- @validate_call
2798
- def list_relation_extraction_templates_with_http_info(
2799
- self,
2800
- username: StrictStr,
2801
- dataset: StrictStr,
2802
- q_answer_api_key: Optional[StrictStr] = None,
2803
- _request_timeout: Union[
2804
- None,
2805
- Annotated[StrictFloat, Field(gt=0)],
2806
- Tuple[
2807
- Annotated[StrictFloat, Field(gt=0)],
2808
- Annotated[StrictFloat, Field(gt=0)]
2809
- ]
2810
- ] = None,
2811
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2812
- _content_type: Optional[StrictStr] = None,
2813
- _headers: Optional[Dict[StrictStr, Any]] = None,
2814
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2815
- ) -> ApiResponse[List[RelationExtractionSchema]]:
2816
- """List all relation extraction templates
2817
-
2818
-
2819
- :param username: (required)
2820
- :type username: str
2821
- :param dataset: (required)
2822
- :type dataset: str
2823
- :param q_answer_api_key:
2824
- :type q_answer_api_key: str
2825
- :param _request_timeout: timeout setting for this request. If one
2826
- number provided, it will be total request
2827
- timeout. It can also be a pair (tuple) of
2828
- (connection, read) timeouts.
2829
- :type _request_timeout: int, tuple(int, int), optional
2830
- :param _request_auth: set to override the auth_settings for an a single
2831
- request; this effectively ignores the
2832
- authentication in the spec for a single request.
2833
- :type _request_auth: dict, optional
2834
- :param _content_type: force content-type for the request.
2835
- :type _content_type: str, Optional
2836
- :param _headers: set to override the headers for a single
2837
- request; this effectively ignores the headers
2838
- in the spec for a single request.
2839
- :type _headers: dict, optional
2840
- :param _host_index: set to override the host_index for a single
2841
- request; this effectively ignores the host_index
2842
- in the spec for a single request.
2843
- :type _host_index: int, optional
2844
- :return: Returns the result object.
2845
- """ # noqa: E501
2846
-
2847
- _param = self._list_relation_extraction_templates_serialize(
2848
- username=username,
2849
- dataset=dataset,
2850
- q_answer_api_key=q_answer_api_key,
2851
- _request_auth=_request_auth,
2852
- _content_type=_content_type,
2853
- _headers=_headers,
2854
- _host_index=_host_index
2855
- )
2856
-
2857
- _response_types_map: Dict[str, Optional[str]] = {
2858
- '200': "List[RelationExtractionSchema]",
2859
- }
2860
- response_data = self.api_client.call_api(
2861
- *_param,
2862
- _request_timeout=_request_timeout
2863
- )
2864
- response_data.read()
2865
- return self.api_client.response_deserialize(
2866
- response_data=response_data,
2867
- response_types_map=_response_types_map,
2868
- )
2869
-
2870
-
2871
- @validate_call
2872
- def list_relation_extraction_templates_without_preload_content(
2873
- self,
2874
- username: StrictStr,
2875
- dataset: StrictStr,
2876
- q_answer_api_key: Optional[StrictStr] = None,
2877
- _request_timeout: Union[
2878
- None,
2879
- Annotated[StrictFloat, Field(gt=0)],
2880
- Tuple[
2881
- Annotated[StrictFloat, Field(gt=0)],
2882
- Annotated[StrictFloat, Field(gt=0)]
2883
- ]
2884
- ] = None,
2885
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2886
- _content_type: Optional[StrictStr] = None,
2887
- _headers: Optional[Dict[StrictStr, Any]] = None,
2888
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2889
- ) -> RESTResponseType:
2890
- """List all relation extraction templates
2891
-
2892
-
2893
- :param username: (required)
2894
- :type username: str
2895
- :param dataset: (required)
2896
- :type dataset: str
2897
- :param q_answer_api_key:
2898
- :type q_answer_api_key: str
2899
- :param _request_timeout: timeout setting for this request. If one
2900
- number provided, it will be total request
2901
- timeout. It can also be a pair (tuple) of
2902
- (connection, read) timeouts.
2903
- :type _request_timeout: int, tuple(int, int), optional
2904
- :param _request_auth: set to override the auth_settings for an a single
2905
- request; this effectively ignores the
2906
- authentication in the spec for a single request.
2907
- :type _request_auth: dict, optional
2908
- :param _content_type: force content-type for the request.
2909
- :type _content_type: str, Optional
2910
- :param _headers: set to override the headers for a single
2911
- request; this effectively ignores the headers
2912
- in the spec for a single request.
2913
- :type _headers: dict, optional
2914
- :param _host_index: set to override the host_index for a single
2915
- request; this effectively ignores the host_index
2916
- in the spec for a single request.
2917
- :type _host_index: int, optional
2918
- :return: Returns the result object.
2919
- """ # noqa: E501
2920
-
2921
- _param = self._list_relation_extraction_templates_serialize(
2922
- username=username,
2923
- dataset=dataset,
2924
- q_answer_api_key=q_answer_api_key,
2925
- _request_auth=_request_auth,
2926
- _content_type=_content_type,
2927
- _headers=_headers,
2928
- _host_index=_host_index
2929
- )
2930
-
2931
- _response_types_map: Dict[str, Optional[str]] = {
2932
- '200': "List[RelationExtractionSchema]",
2933
- }
2934
- response_data = self.api_client.call_api(
2935
- *_param,
2936
- _request_timeout=_request_timeout
2937
- )
2938
- return response_data.response
2939
-
2940
-
2941
- def _list_relation_extraction_templates_serialize(
2942
- self,
2943
- username,
2944
- dataset,
2945
- q_answer_api_key,
2946
- _request_auth,
2947
- _content_type,
2948
- _headers,
2949
- _host_index,
2950
- ) -> RequestSerialized:
2951
-
2952
- _host = None
2953
-
2954
- _collection_formats: Dict[str, str] = {
2955
- }
2956
-
2957
- _path_params: Dict[str, str] = {}
2958
- _query_params: List[Tuple[str, str]] = []
2959
- _header_params: Dict[str, Optional[str]] = _headers or {}
2960
- _form_params: List[Tuple[str, str]] = []
2961
- _files: Dict[
2962
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2963
- ] = {}
2964
- _body_params: Optional[bytes] = None
2965
-
2966
- # process the path parameters
2967
- # process the query parameters
2968
- if username is not None:
2969
-
2970
- _query_params.append(('username', username))
2971
-
2972
- if dataset is not None:
2973
-
2974
- _query_params.append(('dataset', dataset))
2975
-
2976
- # process the header parameters
2977
- if q_answer_api_key is not None:
2978
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
2979
- # process the form parameters
2980
- # process the body parameter
2981
-
2982
-
2983
- # set the HTTP header `Accept`
2984
- if 'Accept' not in _header_params:
2985
- _header_params['Accept'] = self.api_client.select_header_accept(
2986
- [
2987
- '*/*'
2988
- ]
2989
- )
2990
-
2991
-
2992
- # authentication setting
2993
- _auth_settings: List[str] = [
2994
- 'QAnswer-Api-Key',
2995
- 'Bearer'
2996
- ]
2997
-
2998
- return self.api_client.param_serialize(
2999
- method='GET',
3000
- resource_path='/api/tasks/relation-extraction/templates',
3001
- path_params=_path_params,
3002
- query_params=_query_params,
3003
- header_params=_header_params,
3004
- body=_body_params,
3005
- post_params=_form_params,
3006
- files=_files,
3007
- auth_settings=_auth_settings,
3008
- collection_formats=_collection_formats,
3009
- _host=_host,
3010
- _request_auth=_request_auth
3011
- )
3012
-
3013
-
3014
-
3015
-
3016
- @validate_call
3017
- def update_relation_extraction_template(
3018
- self,
3019
- template_id: StrictInt,
3020
- relation_extraction_template_payload: RelationExtractionTemplatePayload,
3021
- q_answer_api_key: Optional[StrictStr] = None,
3022
- _request_timeout: Union[
3023
- None,
3024
- Annotated[StrictFloat, Field(gt=0)],
3025
- Tuple[
3026
- Annotated[StrictFloat, Field(gt=0)],
3027
- Annotated[StrictFloat, Field(gt=0)]
3028
- ]
3029
- ] = None,
3030
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3031
- _content_type: Optional[StrictStr] = None,
3032
- _headers: Optional[Dict[StrictStr, Any]] = None,
3033
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3034
- ) -> RelationExtractionSchema:
3035
- """Update a relation extraction template
3036
-
3037
-
3038
- :param template_id: (required)
3039
- :type template_id: int
3040
- :param relation_extraction_template_payload: (required)
3041
- :type relation_extraction_template_payload: RelationExtractionTemplatePayload
3042
- :param q_answer_api_key:
3043
- :type q_answer_api_key: str
3044
- :param _request_timeout: timeout setting for this request. If one
3045
- number provided, it will be total request
3046
- timeout. It can also be a pair (tuple) of
3047
- (connection, read) timeouts.
3048
- :type _request_timeout: int, tuple(int, int), optional
3049
- :param _request_auth: set to override the auth_settings for an a single
3050
- request; this effectively ignores the
3051
- authentication in the spec for a single request.
3052
- :type _request_auth: dict, optional
3053
- :param _content_type: force content-type for the request.
3054
- :type _content_type: str, Optional
3055
- :param _headers: set to override the headers for a single
3056
- request; this effectively ignores the headers
3057
- in the spec for a single request.
3058
- :type _headers: dict, optional
3059
- :param _host_index: set to override the host_index for a single
3060
- request; this effectively ignores the host_index
3061
- in the spec for a single request.
3062
- :type _host_index: int, optional
3063
- :return: Returns the result object.
3064
- """ # noqa: E501
3065
-
3066
- _param = self._update_relation_extraction_template_serialize(
3067
- template_id=template_id,
3068
- relation_extraction_template_payload=relation_extraction_template_payload,
3069
- q_answer_api_key=q_answer_api_key,
3070
- _request_auth=_request_auth,
3071
- _content_type=_content_type,
3072
- _headers=_headers,
3073
- _host_index=_host_index
3074
- )
3075
-
3076
- _response_types_map: Dict[str, Optional[str]] = {
3077
- '200': "RelationExtractionSchema",
3078
- }
3079
- response_data = self.api_client.call_api(
3080
- *_param,
3081
- _request_timeout=_request_timeout
3082
- )
3083
- response_data.read()
3084
- return self.api_client.response_deserialize(
3085
- response_data=response_data,
3086
- response_types_map=_response_types_map,
3087
- ).data
3088
-
3089
-
3090
- @validate_call
3091
- def update_relation_extraction_template_with_http_info(
3092
- self,
3093
- template_id: StrictInt,
3094
- relation_extraction_template_payload: RelationExtractionTemplatePayload,
3095
- q_answer_api_key: Optional[StrictStr] = None,
3096
- _request_timeout: Union[
3097
- None,
3098
- Annotated[StrictFloat, Field(gt=0)],
3099
- Tuple[
3100
- Annotated[StrictFloat, Field(gt=0)],
3101
- Annotated[StrictFloat, Field(gt=0)]
3102
- ]
3103
- ] = None,
3104
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3105
- _content_type: Optional[StrictStr] = None,
3106
- _headers: Optional[Dict[StrictStr, Any]] = None,
3107
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3108
- ) -> ApiResponse[RelationExtractionSchema]:
3109
- """Update a relation extraction template
3110
-
3111
-
3112
- :param template_id: (required)
3113
- :type template_id: int
3114
- :param relation_extraction_template_payload: (required)
3115
- :type relation_extraction_template_payload: RelationExtractionTemplatePayload
3116
- :param q_answer_api_key:
3117
- :type q_answer_api_key: str
3118
- :param _request_timeout: timeout setting for this request. If one
3119
- number provided, it will be total request
3120
- timeout. It can also be a pair (tuple) of
3121
- (connection, read) timeouts.
3122
- :type _request_timeout: int, tuple(int, int), optional
3123
- :param _request_auth: set to override the auth_settings for an a single
3124
- request; this effectively ignores the
3125
- authentication in the spec for a single request.
3126
- :type _request_auth: dict, optional
3127
- :param _content_type: force content-type for the request.
3128
- :type _content_type: str, Optional
3129
- :param _headers: set to override the headers for a single
3130
- request; this effectively ignores the headers
3131
- in the spec for a single request.
3132
- :type _headers: dict, optional
3133
- :param _host_index: set to override the host_index for a single
3134
- request; this effectively ignores the host_index
3135
- in the spec for a single request.
3136
- :type _host_index: int, optional
3137
- :return: Returns the result object.
3138
- """ # noqa: E501
3139
-
3140
- _param = self._update_relation_extraction_template_serialize(
3141
- template_id=template_id,
3142
- relation_extraction_template_payload=relation_extraction_template_payload,
3143
- q_answer_api_key=q_answer_api_key,
3144
- _request_auth=_request_auth,
3145
- _content_type=_content_type,
3146
- _headers=_headers,
3147
- _host_index=_host_index
3148
- )
3149
-
3150
- _response_types_map: Dict[str, Optional[str]] = {
3151
- '200': "RelationExtractionSchema",
3152
- }
3153
- response_data = self.api_client.call_api(
3154
- *_param,
3155
- _request_timeout=_request_timeout
3156
- )
3157
- response_data.read()
3158
- return self.api_client.response_deserialize(
3159
- response_data=response_data,
3160
- response_types_map=_response_types_map,
3161
- )
3162
-
3163
-
3164
- @validate_call
3165
- def update_relation_extraction_template_without_preload_content(
3166
- self,
3167
- template_id: StrictInt,
3168
- relation_extraction_template_payload: RelationExtractionTemplatePayload,
3169
- q_answer_api_key: Optional[StrictStr] = None,
3170
- _request_timeout: Union[
3171
- None,
3172
- Annotated[StrictFloat, Field(gt=0)],
3173
- Tuple[
3174
- Annotated[StrictFloat, Field(gt=0)],
3175
- Annotated[StrictFloat, Field(gt=0)]
3176
- ]
3177
- ] = None,
3178
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3179
- _content_type: Optional[StrictStr] = None,
3180
- _headers: Optional[Dict[StrictStr, Any]] = None,
3181
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3182
- ) -> RESTResponseType:
3183
- """Update a relation extraction template
3184
-
3185
-
3186
- :param template_id: (required)
3187
- :type template_id: int
3188
- :param relation_extraction_template_payload: (required)
3189
- :type relation_extraction_template_payload: RelationExtractionTemplatePayload
3190
- :param q_answer_api_key:
3191
- :type q_answer_api_key: str
3192
- :param _request_timeout: timeout setting for this request. If one
3193
- number provided, it will be total request
3194
- timeout. It can also be a pair (tuple) of
3195
- (connection, read) timeouts.
3196
- :type _request_timeout: int, tuple(int, int), optional
3197
- :param _request_auth: set to override the auth_settings for an a single
3198
- request; this effectively ignores the
3199
- authentication in the spec for a single request.
3200
- :type _request_auth: dict, optional
3201
- :param _content_type: force content-type for the request.
3202
- :type _content_type: str, Optional
3203
- :param _headers: set to override the headers for a single
3204
- request; this effectively ignores the headers
3205
- in the spec for a single request.
3206
- :type _headers: dict, optional
3207
- :param _host_index: set to override the host_index for a single
3208
- request; this effectively ignores the host_index
3209
- in the spec for a single request.
3210
- :type _host_index: int, optional
3211
- :return: Returns the result object.
3212
- """ # noqa: E501
3213
-
3214
- _param = self._update_relation_extraction_template_serialize(
3215
- template_id=template_id,
3216
- relation_extraction_template_payload=relation_extraction_template_payload,
3217
- q_answer_api_key=q_answer_api_key,
3218
- _request_auth=_request_auth,
3219
- _content_type=_content_type,
3220
- _headers=_headers,
3221
- _host_index=_host_index
3222
- )
3223
-
3224
- _response_types_map: Dict[str, Optional[str]] = {
3225
- '200': "RelationExtractionSchema",
3226
- }
3227
- response_data = self.api_client.call_api(
3228
- *_param,
3229
- _request_timeout=_request_timeout
3230
- )
3231
- return response_data.response
3232
-
3233
-
3234
- def _update_relation_extraction_template_serialize(
3235
- self,
3236
- template_id,
3237
- relation_extraction_template_payload,
3238
- q_answer_api_key,
3239
- _request_auth,
3240
- _content_type,
3241
- _headers,
3242
- _host_index,
3243
- ) -> RequestSerialized:
3244
-
3245
- _host = None
3246
-
3247
- _collection_formats: Dict[str, str] = {
3248
- }
3249
-
3250
- _path_params: Dict[str, str] = {}
3251
- _query_params: List[Tuple[str, str]] = []
3252
- _header_params: Dict[str, Optional[str]] = _headers or {}
3253
- _form_params: List[Tuple[str, str]] = []
3254
- _files: Dict[
3255
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3256
- ] = {}
3257
- _body_params: Optional[bytes] = None
3258
-
3259
- # process the path parameters
3260
- if template_id is not None:
3261
- _path_params['templateId'] = template_id
3262
- # process the query parameters
3263
- # process the header parameters
3264
- if q_answer_api_key is not None:
3265
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
3266
- # process the form parameters
3267
- # process the body parameter
3268
- if relation_extraction_template_payload is not None:
3269
- _body_params = relation_extraction_template_payload
3270
-
3271
-
3272
- # set the HTTP header `Accept`
3273
- if 'Accept' not in _header_params:
3274
- _header_params['Accept'] = self.api_client.select_header_accept(
3275
- [
3276
- '*/*'
3277
- ]
3278
- )
3279
-
3280
- # set the HTTP header `Content-Type`
3281
- if _content_type:
3282
- _header_params['Content-Type'] = _content_type
3283
- else:
3284
- _default_content_type = (
3285
- self.api_client.select_header_content_type(
3286
- [
3287
- 'application/json'
3288
- ]
3289
- )
3290
- )
3291
- if _default_content_type is not None:
3292
- _header_params['Content-Type'] = _default_content_type
3293
-
3294
- # authentication setting
3295
- _auth_settings: List[str] = [
3296
- 'QAnswer-Api-Key',
3297
- 'Bearer'
3298
- ]
3299
-
3300
- return self.api_client.param_serialize(
3301
- method='PUT',
3302
- resource_path='/api/tasks/relation-extraction/templates/{templateId}',
3303
- path_params=_path_params,
3304
- query_params=_query_params,
3305
- header_params=_header_params,
3306
- body=_body_params,
3307
- post_params=_form_params,
3308
- files=_files,
3309
- auth_settings=_auth_settings,
3310
- collection_formats=_collection_formats,
3311
- _host=_host,
3312
- _request_auth=_request_auth
3313
- )
3314
-
3315
-
3316
-
3317
-
3318
- @validate_call
3319
- def upload_relation_extraction_template(
3320
- self,
3321
- username: StrictStr,
3322
- dataset: StrictStr,
3323
- file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
3324
- q_answer_api_key: Optional[StrictStr] = None,
3325
- _request_timeout: Union[
3326
- None,
3327
- Annotated[StrictFloat, Field(gt=0)],
3328
- Tuple[
3329
- Annotated[StrictFloat, Field(gt=0)],
3330
- Annotated[StrictFloat, Field(gt=0)]
3331
- ]
3332
- ] = None,
3333
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3334
- _content_type: Optional[StrictStr] = None,
3335
- _headers: Optional[Dict[StrictStr, Any]] = None,
3336
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3337
- ) -> RelationExtractionSchema:
3338
- """Uploads a relation extraction file CSV or XLSX
3339
-
3340
-
3341
- :param username: (required)
3342
- :type username: str
3343
- :param dataset: (required)
3344
- :type dataset: str
3345
- :param file: (required)
3346
- :type file: bytearray
3347
- :param q_answer_api_key:
3348
- :type q_answer_api_key: str
3349
- :param _request_timeout: timeout setting for this request. If one
3350
- number provided, it will be total request
3351
- timeout. It can also be a pair (tuple) of
3352
- (connection, read) timeouts.
3353
- :type _request_timeout: int, tuple(int, int), optional
3354
- :param _request_auth: set to override the auth_settings for an a single
3355
- request; this effectively ignores the
3356
- authentication in the spec for a single request.
3357
- :type _request_auth: dict, optional
3358
- :param _content_type: force content-type for the request.
3359
- :type _content_type: str, Optional
3360
- :param _headers: set to override the headers for a single
3361
- request; this effectively ignores the headers
3362
- in the spec for a single request.
3363
- :type _headers: dict, optional
3364
- :param _host_index: set to override the host_index for a single
3365
- request; this effectively ignores the host_index
3366
- in the spec for a single request.
3367
- :type _host_index: int, optional
3368
- :return: Returns the result object.
3369
- """ # noqa: E501
3370
-
3371
- _param = self._upload_relation_extraction_template_serialize(
3372
- username=username,
3373
- dataset=dataset,
3374
- file=file,
3375
- q_answer_api_key=q_answer_api_key,
3376
- _request_auth=_request_auth,
3377
- _content_type=_content_type,
3378
- _headers=_headers,
3379
- _host_index=_host_index
3380
- )
3381
-
3382
- _response_types_map: Dict[str, Optional[str]] = {
3383
- '200': "RelationExtractionSchema",
3384
- }
3385
- response_data = self.api_client.call_api(
3386
- *_param,
3387
- _request_timeout=_request_timeout
3388
- )
3389
- response_data.read()
3390
- return self.api_client.response_deserialize(
3391
- response_data=response_data,
3392
- response_types_map=_response_types_map,
3393
- ).data
3394
-
3395
-
3396
- @validate_call
3397
- def upload_relation_extraction_template_with_http_info(
3398
- self,
3399
- username: StrictStr,
3400
- dataset: StrictStr,
3401
- file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
3402
- q_answer_api_key: Optional[StrictStr] = None,
3403
- _request_timeout: Union[
3404
- None,
3405
- Annotated[StrictFloat, Field(gt=0)],
3406
- Tuple[
3407
- Annotated[StrictFloat, Field(gt=0)],
3408
- Annotated[StrictFloat, Field(gt=0)]
3409
- ]
3410
- ] = None,
3411
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3412
- _content_type: Optional[StrictStr] = None,
3413
- _headers: Optional[Dict[StrictStr, Any]] = None,
3414
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3415
- ) -> ApiResponse[RelationExtractionSchema]:
3416
- """Uploads a relation extraction file CSV or XLSX
3417
-
3418
-
3419
- :param username: (required)
3420
- :type username: str
3421
- :param dataset: (required)
3422
- :type dataset: str
3423
- :param file: (required)
3424
- :type file: bytearray
3425
- :param q_answer_api_key:
3426
- :type q_answer_api_key: str
3427
- :param _request_timeout: timeout setting for this request. If one
3428
- number provided, it will be total request
3429
- timeout. It can also be a pair (tuple) of
3430
- (connection, read) timeouts.
3431
- :type _request_timeout: int, tuple(int, int), optional
3432
- :param _request_auth: set to override the auth_settings for an a single
3433
- request; this effectively ignores the
3434
- authentication in the spec for a single request.
3435
- :type _request_auth: dict, optional
3436
- :param _content_type: force content-type for the request.
3437
- :type _content_type: str, Optional
3438
- :param _headers: set to override the headers for a single
3439
- request; this effectively ignores the headers
3440
- in the spec for a single request.
3441
- :type _headers: dict, optional
3442
- :param _host_index: set to override the host_index for a single
3443
- request; this effectively ignores the host_index
3444
- in the spec for a single request.
3445
- :type _host_index: int, optional
3446
- :return: Returns the result object.
3447
- """ # noqa: E501
3448
-
3449
- _param = self._upload_relation_extraction_template_serialize(
3450
- username=username,
3451
- dataset=dataset,
3452
- file=file,
3453
- q_answer_api_key=q_answer_api_key,
3454
- _request_auth=_request_auth,
3455
- _content_type=_content_type,
3456
- _headers=_headers,
3457
- _host_index=_host_index
3458
- )
3459
-
3460
- _response_types_map: Dict[str, Optional[str]] = {
3461
- '200': "RelationExtractionSchema",
3462
- }
3463
- response_data = self.api_client.call_api(
3464
- *_param,
3465
- _request_timeout=_request_timeout
3466
- )
3467
- response_data.read()
3468
- return self.api_client.response_deserialize(
3469
- response_data=response_data,
3470
- response_types_map=_response_types_map,
3471
- )
3472
-
3473
-
3474
- @validate_call
3475
- def upload_relation_extraction_template_without_preload_content(
3476
- self,
3477
- username: StrictStr,
3478
- dataset: StrictStr,
3479
- file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
3480
- q_answer_api_key: Optional[StrictStr] = None,
3481
- _request_timeout: Union[
3482
- None,
3483
- Annotated[StrictFloat, Field(gt=0)],
3484
- Tuple[
3485
- Annotated[StrictFloat, Field(gt=0)],
3486
- Annotated[StrictFloat, Field(gt=0)]
3487
- ]
3488
- ] = None,
3489
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3490
- _content_type: Optional[StrictStr] = None,
3491
- _headers: Optional[Dict[StrictStr, Any]] = None,
3492
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3493
- ) -> RESTResponseType:
3494
- """Uploads a relation extraction file CSV or XLSX
3495
-
3496
-
3497
- :param username: (required)
3498
- :type username: str
3499
- :param dataset: (required)
3500
- :type dataset: str
3501
- :param file: (required)
3502
- :type file: bytearray
3503
- :param q_answer_api_key:
3504
- :type q_answer_api_key: str
3505
- :param _request_timeout: timeout setting for this request. If one
3506
- number provided, it will be total request
3507
- timeout. It can also be a pair (tuple) of
3508
- (connection, read) timeouts.
3509
- :type _request_timeout: int, tuple(int, int), optional
3510
- :param _request_auth: set to override the auth_settings for an a single
3511
- request; this effectively ignores the
3512
- authentication in the spec for a single request.
3513
- :type _request_auth: dict, optional
3514
- :param _content_type: force content-type for the request.
3515
- :type _content_type: str, Optional
3516
- :param _headers: set to override the headers for a single
3517
- request; this effectively ignores the headers
3518
- in the spec for a single request.
3519
- :type _headers: dict, optional
3520
- :param _host_index: set to override the host_index for a single
3521
- request; this effectively ignores the host_index
3522
- in the spec for a single request.
3523
- :type _host_index: int, optional
3524
- :return: Returns the result object.
3525
- """ # noqa: E501
3526
-
3527
- _param = self._upload_relation_extraction_template_serialize(
3528
- username=username,
3529
- dataset=dataset,
3530
- file=file,
3531
- q_answer_api_key=q_answer_api_key,
3532
- _request_auth=_request_auth,
3533
- _content_type=_content_type,
3534
- _headers=_headers,
3535
- _host_index=_host_index
3536
- )
3537
-
3538
- _response_types_map: Dict[str, Optional[str]] = {
3539
- '200': "RelationExtractionSchema",
3540
- }
3541
- response_data = self.api_client.call_api(
3542
- *_param,
3543
- _request_timeout=_request_timeout
3544
- )
3545
- return response_data.response
3546
-
3547
-
3548
- def _upload_relation_extraction_template_serialize(
3549
- self,
3550
- username,
3551
- dataset,
3552
- file,
3553
- q_answer_api_key,
3554
- _request_auth,
3555
- _content_type,
3556
- _headers,
3557
- _host_index,
3558
- ) -> RequestSerialized:
3559
-
3560
- _host = None
3561
-
3562
- _collection_formats: Dict[str, str] = {
3563
- }
3564
-
3565
- _path_params: Dict[str, str] = {}
3566
- _query_params: List[Tuple[str, str]] = []
3567
- _header_params: Dict[str, Optional[str]] = _headers or {}
3568
- _form_params: List[Tuple[str, str]] = []
3569
- _files: Dict[
3570
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3571
- ] = {}
3572
- _body_params: Optional[bytes] = None
3573
-
3574
- # process the path parameters
3575
- # process the query parameters
3576
- if username is not None:
3577
-
3578
- _query_params.append(('username', username))
3579
-
3580
- if dataset is not None:
3581
-
3582
- _query_params.append(('dataset', dataset))
3583
-
3584
- # process the header parameters
3585
- if q_answer_api_key is not None:
3586
- _header_params['QAnswer-Api-Key'] = q_answer_api_key
3587
- # process the form parameters
3588
- if file is not None:
3589
- _files['file'] = file
3590
- # process the body parameter
3591
-
3592
-
3593
- # set the HTTP header `Accept`
3594
- if 'Accept' not in _header_params:
3595
- _header_params['Accept'] = self.api_client.select_header_accept(
3596
- [
3597
- '*/*'
3598
- ]
3599
- )
3600
-
3601
- # set the HTTP header `Content-Type`
3602
- if _content_type:
3603
- _header_params['Content-Type'] = _content_type
3604
- else:
3605
- _default_content_type = (
3606
- self.api_client.select_header_content_type(
3607
- [
3608
- 'multipart/form-data'
3609
- ]
3610
- )
3611
- )
3612
- if _default_content_type is not None:
3613
- _header_params['Content-Type'] = _default_content_type
3614
-
3615
- # authentication setting
3616
- _auth_settings: List[str] = [
3617
- 'QAnswer-Api-Key',
3618
- 'Bearer'
3619
- ]
3620
-
3621
- return self.api_client.param_serialize(
3622
- method='POST',
3623
- resource_path='/api/tasks/relation-extraction/templates/upload',
3624
- path_params=_path_params,
3625
- query_params=_query_params,
3626
- header_params=_header_params,
3627
- body=_body_params,
3628
- post_params=_form_params,
3629
- files=_files,
3630
- auth_settings=_auth_settings,
3631
- collection_formats=_collection_formats,
3632
- _host=_host,
3633
- _request_auth=_request_auth
3634
- )
3635
-
3636
-