qanswer_sdk 3.1193.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.
- qanswer_sdk/__init__.py +366 -0
- qanswer_sdk/api/__init__.py +47 -0
- qanswer_sdk/api/admin_api.py +11207 -0
- qanswer_sdk/api/ai_assistant_access_rights_api.py +5331 -0
- qanswer_sdk/api/ai_assistant_api.py +4377 -0
- qanswer_sdk/api/bot_slack_api.py +814 -0
- qanswer_sdk/api/chat_completion_api.py +309 -0
- qanswer_sdk/api/chatbot_api.py +1091 -0
- qanswer_sdk/api/connector_document_api.py +1406 -0
- qanswer_sdk/api/connector_e_consilium_api.py +326 -0
- qanswer_sdk/api/connector_e_consilium_search_index_connector_api.py +1215 -0
- qanswer_sdk/api/connector_google_drive_api.py +1870 -0
- qanswer_sdk/api/connector_one_drive_api.py +1559 -0
- qanswer_sdk/api/connector_onenote_api.py +1576 -0
- qanswer_sdk/api/connector_pinecone_api.py +892 -0
- qanswer_sdk/api/connector_publication_office_controller_api.py +1215 -0
- qanswer_sdk/api/connector_qn_a_api.py +1538 -0
- qanswer_sdk/api/connector_rdf_answer_api.py +1445 -0
- qanswer_sdk/api/connector_rdf_api.py +5318 -0
- qanswer_sdk/api/connector_sharepoint_api.py +2584 -0
- qanswer_sdk/api/connector_websearch_api.py +326 -0
- qanswer_sdk/api/connector_website_api.py +2068 -0
- qanswer_sdk/api/connectors_api.py +1497 -0
- qanswer_sdk/api/connectors_data_api.py +3697 -0
- qanswer_sdk/api/conversation_logs_api.py +6668 -0
- qanswer_sdk/api/dataset_config_api.py +2178 -0
- qanswer_sdk/api/debug_api.py +282 -0
- qanswer_sdk/api/llm_api.py +563 -0
- qanswer_sdk/api/llm_consumption_controller_api.py +310 -0
- qanswer_sdk/api/organizations_teams_api.py +8465 -0
- qanswer_sdk/api/payment_api.py +1546 -0
- qanswer_sdk/api/socket_api.py +2975 -0
- qanswer_sdk/api/speech_to_text_api.py +734 -0
- qanswer_sdk/api/tag_api.py +2396 -0
- qanswer_sdk/api/task_chat_api.py +2064 -0
- qanswer_sdk/api/task_rdf_linker_api.py +4382 -0
- qanswer_sdk/api/task_rdf_sparql_endpoint_api.py +3522 -0
- qanswer_sdk/api/task_rdf_text_linker_api.py +1346 -0
- qanswer_sdk/api/task_relation_extraction_api.py +2977 -0
- qanswer_sdk/api/task_report_copilot_api.py +2980 -0
- qanswer_sdk/api/task_search_api.py +1784 -0
- qanswer_sdk/api/task_sparql2text_api.py +326 -0
- qanswer_sdk/api/task_text2sparql_api.py +908 -0
- qanswer_sdk/api/task_text_classification_api.py +914 -0
- qanswer_sdk/api/user_api.py +7098 -0
- qanswer_sdk/api_client.py +797 -0
- qanswer_sdk/api_response.py +21 -0
- qanswer_sdk/configuration.py +487 -0
- qanswer_sdk/exceptions.py +199 -0
- qanswer_sdk/models/__init__.py +307 -0
- qanswer_sdk/models/access_pdf_payload_model.py +109 -0
- qanswer_sdk/models/add_qn_a_request.py +103 -0
- qanswer_sdk/models/add_synonyms.py +91 -0
- qanswer_sdk/models/add_synonyms_resp.py +89 -0
- qanswer_sdk/models/aggregate.py +97 -0
- qanswer_sdk/models/aggregation.py +112 -0
- qanswer_sdk/models/aggregations_group.py +102 -0
- qanswer_sdk/models/ai_assistant_dto.py +103 -0
- qanswer_sdk/models/ai_assistant_shared_access.py +113 -0
- qanswer_sdk/models/allowed_file_extensions.py +98 -0
- qanswer_sdk/models/api_response.py +87 -0
- qanswer_sdk/models/applied_metadata_filter.py +98 -0
- qanswer_sdk/models/assistant_message_stop.py +93 -0
- qanswer_sdk/models/auth_link_response.py +91 -0
- qanswer_sdk/models/autocompletion_config.py +93 -0
- qanswer_sdk/models/available_connectors_response.py +99 -0
- qanswer_sdk/models/available_embedding_models_response.py +95 -0
- qanswer_sdk/models/available_endpoints_response.py +95 -0
- qanswer_sdk/models/available_logs_visibility_policy.py +103 -0
- qanswer_sdk/models/available_space_quota_for_dataset.py +91 -0
- qanswer_sdk/models/available_storage_preference.py +103 -0
- qanswer_sdk/models/base_connectors_response.py +89 -0
- qanswer_sdk/models/base_conversation_response.py +89 -0
- qanswer_sdk/models/base_feedback_response.py +89 -0
- qanswer_sdk/models/branding_data.py +87 -0
- qanswer_sdk/models/cell.py +89 -0
- qanswer_sdk/models/change_password.py +89 -0
- qanswer_sdk/models/change_password_admin.py +89 -0
- qanswer_sdk/models/change_role.py +96 -0
- qanswer_sdk/models/chat_task_settings.py +135 -0
- qanswer_sdk/models/chat_task_settings_update_payload.py +95 -0
- qanswer_sdk/models/chat_task_update.py +129 -0
- qanswer_sdk/models/chatbot_chat_payload.py +115 -0
- qanswer_sdk/models/chatbot_conversation_model.py +141 -0
- qanswer_sdk/models/chatbot_response.py +119 -0
- qanswer_sdk/models/check_mode_response.py +100 -0
- qanswer_sdk/models/class_info.py +89 -0
- qanswer_sdk/models/connector_model.py +112 -0
- qanswer_sdk/models/content_item.py +130 -0
- qanswer_sdk/models/conversation_message.py +186 -0
- qanswer_sdk/models/conversation_model.py +131 -0
- qanswer_sdk/models/conversation_statistics.py +95 -0
- qanswer_sdk/models/conversation_update.py +93 -0
- qanswer_sdk/models/conversation_users_stats.py +99 -0
- qanswer_sdk/models/conversation_users_stats_response.py +99 -0
- qanswer_sdk/models/coordinates.py +89 -0
- qanswer_sdk/models/cost_summary.py +99 -0
- qanswer_sdk/models/create_connector_request.py +93 -0
- qanswer_sdk/models/create_connector_response.py +95 -0
- qanswer_sdk/models/create_pinecone_connector_request.py +95 -0
- qanswer_sdk/models/create_sharepoint_connector_from_certificate_request.py +103 -0
- qanswer_sdk/models/create_sharepoint_connector_request.py +101 -0
- qanswer_sdk/models/dataset_config_request.py +187 -0
- qanswer_sdk/models/dataset_default_values_model.py +141 -0
- qanswer_sdk/models/dataset_description.py +91 -0
- qanswer_sdk/models/dataset_detail.py +133 -0
- qanswer_sdk/models/dataset_detail_kg.py +158 -0
- qanswer_sdk/models/dataset_schema.py +207 -0
- qanswer_sdk/models/dataset_update_object.py +195 -0
- qanswer_sdk/models/dataset_users_response.py +87 -0
- qanswer_sdk/models/default_prompt.py +106 -0
- qanswer_sdk/models/delete_connector_model.py +96 -0
- qanswer_sdk/models/delete_connector_request.py +99 -0
- qanswer_sdk/models/delete_connectors_response.py +91 -0
- qanswer_sdk/models/delete_qn_a_pair_request.py +95 -0
- qanswer_sdk/models/delete_qn_a_pair_response.py +89 -0
- qanswer_sdk/models/delete_synonym.py +91 -0
- qanswer_sdk/models/delete_synonym_resp.py +89 -0
- qanswer_sdk/models/diarization_segment.py +93 -0
- qanswer_sdk/models/document_content_response.py +91 -0
- qanswer_sdk/models/document_content_update_model.py +95 -0
- qanswer_sdk/models/document_file_delete_by_connector_model.py +99 -0
- qanswer_sdk/models/document_metadata.py +107 -0
- qanswer_sdk/models/document_metadata_list_wrapper.py +95 -0
- qanswer_sdk/models/document_status_response.py +89 -0
- qanswer_sdk/models/e_consilium_search_index_search_response.py +113 -0
- qanswer_sdk/models/econsilium_file_metadata.py +105 -0
- qanswer_sdk/models/econsilium_search_index_add_payload.py +105 -0
- qanswer_sdk/models/econsilium_search_index_additional_fields.py +101 -0
- qanswer_sdk/models/email_request.py +87 -0
- qanswer_sdk/models/embedding_endpoint.py +139 -0
- qanswer_sdk/models/embedding_endpoint_create.py +137 -0
- qanswer_sdk/models/embedding_endpoint_update.py +131 -0
- qanswer_sdk/models/embedding_endpoint_validation_response.py +96 -0
- qanswer_sdk/models/embedding_model.py +96 -0
- qanswer_sdk/models/entity.py +97 -0
- qanswer_sdk/models/entity_linker_response.py +99 -0
- qanswer_sdk/models/entity_model.py +99 -0
- qanswer_sdk/models/extra_body.py +91 -0
- qanswer_sdk/models/extract_hyper_links_payload.py +102 -0
- qanswer_sdk/models/extract_robot_links_payload.py +88 -0
- qanswer_sdk/models/extract_robot_links_response.py +88 -0
- qanswer_sdk/models/fact.py +96 -0
- qanswer_sdk/models/feedback_model.py +107 -0
- qanswer_sdk/models/feedback_update.py +103 -0
- qanswer_sdk/models/file_es_meta_data.py +89 -0
- qanswer_sdk/models/file_folder_model.py +113 -0
- qanswer_sdk/models/file_model.py +134 -0
- qanswer_sdk/models/files_by_connector_model.py +89 -0
- qanswer_sdk/models/format_return.py +87 -0
- qanswer_sdk/models/g_drive_connector_info.py +95 -0
- qanswer_sdk/models/g_drive_download_by_ids.py +89 -0
- qanswer_sdk/models/g_drive_download_request.py +101 -0
- qanswer_sdk/models/generation_params.py +89 -0
- qanswer_sdk/models/get_connector_by_id_response.py +91 -0
- qanswer_sdk/models/get_conversation_response.py +95 -0
- qanswer_sdk/models/guardrail_endpoint.py +121 -0
- qanswer_sdk/models/has_lucene_index_result.py +87 -0
- qanswer_sdk/models/index_config.py +95 -0
- qanswer_sdk/models/install_response.py +89 -0
- qanswer_sdk/models/is_enabled_response.py +87 -0
- qanswer_sdk/models/is_merging_result.py +87 -0
- qanswer_sdk/models/json_nullable_file_failure_reason.py +87 -0
- qanswer_sdk/models/json_nullable_source_metadata.py +87 -0
- qanswer_sdk/models/jwt_authentication_response.py +93 -0
- qanswer_sdk/models/label.py +89 -0
- qanswer_sdk/models/labeled_node.py +89 -0
- qanswer_sdk/models/link.py +103 -0
- qanswer_sdk/models/link_extraction_response.py +97 -0
- qanswer_sdk/models/link_result_paginated.py +97 -0
- qanswer_sdk/models/linker.py +103 -0
- qanswer_sdk/models/linking_result.py +95 -0
- qanswer_sdk/models/links.py +99 -0
- qanswer_sdk/models/list_chatbot_conversation_response.py +105 -0
- qanswer_sdk/models/list_connectors_response.py +95 -0
- qanswer_sdk/models/list_conversation_response.py +105 -0
- qanswer_sdk/models/list_feedback_response.py +105 -0
- qanswer_sdk/models/list_files_connector_response.py +101 -0
- qanswer_sdk/models/list_socket_events.py +95 -0
- qanswer_sdk/models/list_synonyms_model.py +89 -0
- qanswer_sdk/models/llm_context_ranges_response.py +93 -0
- qanswer_sdk/models/llm_cost.py +108 -0
- qanswer_sdk/models/llm_details.py +111 -0
- qanswer_sdk/models/llm_endpoint.py +167 -0
- qanswer_sdk/models/llm_endpoint_create.py +165 -0
- qanswer_sdk/models/llm_endpoint_default_prompts.py +93 -0
- qanswer_sdk/models/llm_endpoint_update.py +163 -0
- qanswer_sdk/models/llm_endpoint_validation_response.py +96 -0
- qanswer_sdk/models/login_request.py +89 -0
- qanswer_sdk/models/logo.py +89 -0
- qanswer_sdk/models/lucene_index_request_result.py +87 -0
- qanswer_sdk/models/merge_request_result.py +87 -0
- qanswer_sdk/models/messages_stats_per_day_response.py +99 -0
- qanswer_sdk/models/modify_connector_request.py +111 -0
- qanswer_sdk/models/o_auth_service.py +89 -0
- qanswer_sdk/models/one_drive_download_by_ids.py +89 -0
- qanswer_sdk/models/one_drive_download_request.py +101 -0
- qanswer_sdk/models/one_note_download_by_ids.py +91 -0
- qanswer_sdk/models/one_note_download_request.py +101 -0
- qanswer_sdk/models/organization.py +93 -0
- qanswer_sdk/models/organization_creation.py +91 -0
- qanswer_sdk/models/organization_filter.py +87 -0
- qanswer_sdk/models/organization_shared.py +105 -0
- qanswer_sdk/models/page_organization.py +123 -0
- qanswer_sdk/models/page_team_with_count.py +123 -0
- qanswer_sdk/models/pageable.py +92 -0
- qanswer_sdk/models/pageable_object.py +101 -0
- qanswer_sdk/models/password.py +89 -0
- qanswer_sdk/models/pinecone_index_model.py +91 -0
- qanswer_sdk/models/plan.py +123 -0
- qanswer_sdk/models/predicted_class.py +89 -0
- qanswer_sdk/models/prompt_token_count_details.py +99 -0
- qanswer_sdk/models/provider.py +87 -0
- qanswer_sdk/models/publication_add_payload.py +103 -0
- qanswer_sdk/models/publication_file_metadata.py +105 -0
- qanswer_sdk/models/publication_office_additional_fields.py +111 -0
- qanswer_sdk/models/publication_search_index_search_response.py +113 -0
- qanswer_sdk/models/qa_context.py +129 -0
- qanswer_sdk/models/qa_contexts.py +116 -0
- qanswer_sdk/models/qa_metadata_payload.py +123 -0
- qanswer_sdk/models/qa_table.py +102 -0
- qanswer_sdk/models/qn_a_pair_model.py +103 -0
- qanswer_sdk/models/qn_a_pair_response.py +95 -0
- qanswer_sdk/models/question_completion.py +89 -0
- qanswer_sdk/models/rag_params.py +89 -0
- qanswer_sdk/models/rag_payload.py +154 -0
- qanswer_sdk/models/rag_response.py +150 -0
- qanswer_sdk/models/ranker_config.py +93 -0
- qanswer_sdk/models/reference_model.py +95 -0
- qanswer_sdk/models/refresh_token_request.py +87 -0
- qanswer_sdk/models/refresh_website_connector_payload.py +94 -0
- qanswer_sdk/models/register_pinecone_connector_request.py +95 -0
- qanswer_sdk/models/relation_extraction_configuration.py +105 -0
- qanswer_sdk/models/relation_extraction_payload.py +111 -0
- qanswer_sdk/models/relation_extraction_result.py +101 -0
- qanswer_sdk/models/relation_extraction_schema.py +101 -0
- qanswer_sdk/models/relation_extraction_task_settings.py +123 -0
- qanswer_sdk/models/relation_extraction_task_settings_update_payload.py +95 -0
- qanswer_sdk/models/relation_extraction_task_update.py +117 -0
- qanswer_sdk/models/relation_extraction_template_payload.py +97 -0
- qanswer_sdk/models/relation_extraction_template_update_payload.py +95 -0
- qanswer_sdk/models/relation_model.py +89 -0
- qanswer_sdk/models/report_copilot_create_payload.py +103 -0
- qanswer_sdk/models/report_copilot_export_template_as_docx_payload_simplified.py +91 -0
- qanswer_sdk/models/report_copilot_generation_from_slots_payload.py +95 -0
- qanswer_sdk/models/report_copilot_generation_from_slots_response.py +95 -0
- qanswer_sdk/models/report_copilot_refinement_payload.py +104 -0
- qanswer_sdk/models/report_copilot_refinement_response.py +87 -0
- qanswer_sdk/models/report_copilot_slot_task_settings.py +125 -0
- qanswer_sdk/models/report_copilot_slot_task_update.py +119 -0
- qanswer_sdk/models/report_copilot_task_settings.py +123 -0
- qanswer_sdk/models/report_copilot_task_settings_update_payload.py +95 -0
- qanswer_sdk/models/report_copilot_task_update.py +117 -0
- qanswer_sdk/models/report_copilot_template.py +107 -0
- qanswer_sdk/models/report_copilot_template_simplified.py +95 -0
- qanswer_sdk/models/report_copilot_update_payload.py +101 -0
- qanswer_sdk/models/reset_password.py +87 -0
- qanswer_sdk/models/response_audit_model.py +99 -0
- qanswer_sdk/models/response_audit_stats_response.py +101 -0
- qanswer_sdk/models/retreive_all_synonyms_resp.py +99 -0
- qanswer_sdk/models/retry_params.py +89 -0
- qanswer_sdk/models/role.py +99 -0
- qanswer_sdk/models/search_document_response.py +105 -0
- qanswer_sdk/models/search_index_payload.py +114 -0
- qanswer_sdk/models/search_metadata_filter.py +89 -0
- qanswer_sdk/models/search_payload.py +124 -0
- qanswer_sdk/models/search_response.py +113 -0
- qanswer_sdk/models/search_task_settings.py +131 -0
- qanswer_sdk/models/search_task_settings_update_payload.py +95 -0
- qanswer_sdk/models/search_task_update.py +123 -0
- qanswer_sdk/models/set_logo1_request.py +87 -0
- qanswer_sdk/models/share_point_download_by_ids.py +99 -0
- qanswer_sdk/models/share_point_download_request.py +101 -0
- qanswer_sdk/models/shared_organization_access.py +109 -0
- qanswer_sdk/models/shared_team_access.py +107 -0
- qanswer_sdk/models/shared_user.py +99 -0
- qanswer_sdk/models/sign_up_request.py +96 -0
- qanswer_sdk/models/signout_request.py +87 -0
- qanswer_sdk/models/slot.py +138 -0
- qanswer_sdk/models/slot_in_prompt.py +91 -0
- qanswer_sdk/models/slot_update.py +138 -0
- qanswer_sdk/models/socket_conversation_message.py +207 -0
- qanswer_sdk/models/socket_data_extraction.py +109 -0
- qanswer_sdk/models/socket_file_metadata.py +172 -0
- qanswer_sdk/models/socket_join_conversation.py +97 -0
- qanswer_sdk/models/socket_join_dataset.py +93 -0
- qanswer_sdk/models/socket_report_continuation_response.py +106 -0
- qanswer_sdk/models/socket_report_copilot_generation_from_slots_response.py +120 -0
- qanswer_sdk/models/socket_report_copilot_refinement_response.py +108 -0
- qanswer_sdk/models/socket_speech2_text_response.py +99 -0
- qanswer_sdk/models/socket_stop_conversation.py +97 -0
- qanswer_sdk/models/sort_object.py +91 -0
- qanswer_sdk/models/source.py +125 -0
- qanswer_sdk/models/sparql2_text_payload.py +97 -0
- qanswer_sdk/models/speech2_text_response.py +87 -0
- qanswer_sdk/models/speech2_text_with_diarization_response.py +106 -0
- qanswer_sdk/models/stat_per_date.py +89 -0
- qanswer_sdk/models/status_response.py +89 -0
- qanswer_sdk/models/subject_model.py +91 -0
- qanswer_sdk/models/suggestion_list_response.py +87 -0
- qanswer_sdk/models/summa_server.py +101 -0
- qanswer_sdk/models/tag_payload.py +87 -0
- qanswer_sdk/models/tag_qa_list_payload.py +100 -0
- qanswer_sdk/models/tag_qa_payload.py +91 -0
- qanswer_sdk/models/team.py +93 -0
- qanswer_sdk/models/team_creation.py +89 -0
- qanswer_sdk/models/team_filter.py +91 -0
- qanswer_sdk/models/team_shared.py +105 -0
- qanswer_sdk/models/team_with_count.py +95 -0
- qanswer_sdk/models/terms_bucket.py +89 -0
- qanswer_sdk/models/text2_sparql_payload.py +156 -0
- qanswer_sdk/models/text2_sparql_task_settings.py +123 -0
- qanswer_sdk/models/text2_sparql_task_settings_update_payload.py +95 -0
- qanswer_sdk/models/text2_sparql_task_update.py +117 -0
- qanswer_sdk/models/text_classification_payload.py +99 -0
- qanswer_sdk/models/text_classification_response.py +87 -0
- qanswer_sdk/models/text_classification_v2_payload.py +99 -0
- qanswer_sdk/models/text_classification_v2_response.py +95 -0
- qanswer_sdk/models/total_stat.py +96 -0
- qanswer_sdk/models/ui_mappings.py +141 -0
- qanswer_sdk/models/update_metadata_model.py +95 -0
- qanswer_sdk/models/update_qn_a_pair_request.py +101 -0
- qanswer_sdk/models/update_qn_a_pair_response.py +89 -0
- qanswer_sdk/models/update_synonyms.py +93 -0
- qanswer_sdk/models/update_synonyms_resp.py +89 -0
- qanswer_sdk/models/uri_mapping.py +89 -0
- qanswer_sdk/models/user.py +91 -0
- qanswer_sdk/models/user_chatbot_setting_payload.py +106 -0
- qanswer_sdk/models/user_chatbot_setting_response.py +105 -0
- qanswer_sdk/models/user_dataset.py +144 -0
- qanswer_sdk/models/user_dataset_api_key.py +116 -0
- qanswer_sdk/models/user_filter.py +101 -0
- qanswer_sdk/models/user_identity_availability.py +87 -0
- qanswer_sdk/models/user_list_dto.py +101 -0
- qanswer_sdk/models/user_oauth_token.py +96 -0
- qanswer_sdk/models/user_profile.py +184 -0
- qanswer_sdk/models/user_profile_list_dto.py +101 -0
- qanswer_sdk/models/user_profile_paginated.py +101 -0
- qanswer_sdk/models/website_add_payload.py +98 -0
- qanswer_sdk/models/website_connector_settings.py +160 -0
- qanswer_sdk/models/widget_configs.py +105 -0
- qanswer_sdk/py.typed +0 -0
- qanswer_sdk/rest.py +257 -0
- qanswer_sdk-3.1193.0.dist-info/METADATA +125 -0
- qanswer_sdk-3.1193.0.dist-info/RECORD +346 -0
- qanswer_sdk-3.1193.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,2977 @@
|
|
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.relation_extraction_configuration import RelationExtractionConfiguration
|
22
|
+
from qanswer_sdk.models.relation_extraction_payload import RelationExtractionPayload
|
23
|
+
from qanswer_sdk.models.relation_extraction_result import RelationExtractionResult
|
24
|
+
from qanswer_sdk.models.relation_extraction_schema import RelationExtractionSchema
|
25
|
+
from qanswer_sdk.models.relation_extraction_task_settings import RelationExtractionTaskSettings
|
26
|
+
from qanswer_sdk.models.relation_extraction_task_settings_update_payload import RelationExtractionTaskSettingsUpdatePayload
|
27
|
+
from qanswer_sdk.models.relation_extraction_template_payload import RelationExtractionTemplatePayload
|
28
|
+
from qanswer_sdk.models.relation_extraction_template_update_payload import RelationExtractionTemplateUpdatePayload
|
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 free_text_relation_extraction_task_read_settings(
|
638
|
+
self,
|
639
|
+
username: StrictStr,
|
640
|
+
dataset: StrictStr,
|
641
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
642
|
+
_request_timeout: Union[
|
643
|
+
None,
|
644
|
+
Annotated[StrictFloat, Field(gt=0)],
|
645
|
+
Tuple[
|
646
|
+
Annotated[StrictFloat, Field(gt=0)],
|
647
|
+
Annotated[StrictFloat, Field(gt=0)]
|
648
|
+
]
|
649
|
+
] = None,
|
650
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
651
|
+
_content_type: Optional[StrictStr] = None,
|
652
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
653
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
654
|
+
) -> RelationExtractionTaskSettings:
|
655
|
+
"""This reads the settings of the relation-extraction task
|
656
|
+
|
657
|
+
|
658
|
+
:param username: (required)
|
659
|
+
:type username: str
|
660
|
+
:param dataset: (required)
|
661
|
+
:type dataset: str
|
662
|
+
:param q_answer_api_key:
|
663
|
+
:type q_answer_api_key: str
|
664
|
+
:param _request_timeout: timeout setting for this request. If one
|
665
|
+
number provided, it will be total request
|
666
|
+
timeout. It can also be a pair (tuple) of
|
667
|
+
(connection, read) timeouts.
|
668
|
+
:type _request_timeout: int, tuple(int, int), optional
|
669
|
+
:param _request_auth: set to override the auth_settings for an a single
|
670
|
+
request; this effectively ignores the
|
671
|
+
authentication in the spec for a single request.
|
672
|
+
:type _request_auth: dict, optional
|
673
|
+
:param _content_type: force content-type for the request.
|
674
|
+
:type _content_type: str, Optional
|
675
|
+
:param _headers: set to override the headers for a single
|
676
|
+
request; this effectively ignores the headers
|
677
|
+
in the spec for a single request.
|
678
|
+
:type _headers: dict, optional
|
679
|
+
:param _host_index: set to override the host_index for a single
|
680
|
+
request; this effectively ignores the host_index
|
681
|
+
in the spec for a single request.
|
682
|
+
:type _host_index: int, optional
|
683
|
+
:return: Returns the result object.
|
684
|
+
""" # noqa: E501
|
685
|
+
|
686
|
+
_param = self._free_text_relation_extraction_task_read_settings_serialize(
|
687
|
+
username=username,
|
688
|
+
dataset=dataset,
|
689
|
+
q_answer_api_key=q_answer_api_key,
|
690
|
+
_request_auth=_request_auth,
|
691
|
+
_content_type=_content_type,
|
692
|
+
_headers=_headers,
|
693
|
+
_host_index=_host_index
|
694
|
+
)
|
695
|
+
|
696
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
697
|
+
'200': "RelationExtractionTaskSettings",
|
698
|
+
}
|
699
|
+
response_data = self.api_client.call_api(
|
700
|
+
*_param,
|
701
|
+
_request_timeout=_request_timeout
|
702
|
+
)
|
703
|
+
response_data.read()
|
704
|
+
return self.api_client.response_deserialize(
|
705
|
+
response_data=response_data,
|
706
|
+
response_types_map=_response_types_map,
|
707
|
+
).data
|
708
|
+
|
709
|
+
|
710
|
+
@validate_call
|
711
|
+
def free_text_relation_extraction_task_read_settings_with_http_info(
|
712
|
+
self,
|
713
|
+
username: StrictStr,
|
714
|
+
dataset: StrictStr,
|
715
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
716
|
+
_request_timeout: Union[
|
717
|
+
None,
|
718
|
+
Annotated[StrictFloat, Field(gt=0)],
|
719
|
+
Tuple[
|
720
|
+
Annotated[StrictFloat, Field(gt=0)],
|
721
|
+
Annotated[StrictFloat, Field(gt=0)]
|
722
|
+
]
|
723
|
+
] = None,
|
724
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
725
|
+
_content_type: Optional[StrictStr] = None,
|
726
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
727
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
728
|
+
) -> ApiResponse[RelationExtractionTaskSettings]:
|
729
|
+
"""This reads the settings of the relation-extraction task
|
730
|
+
|
731
|
+
|
732
|
+
:param username: (required)
|
733
|
+
:type username: str
|
734
|
+
:param dataset: (required)
|
735
|
+
:type dataset: str
|
736
|
+
:param q_answer_api_key:
|
737
|
+
:type q_answer_api_key: str
|
738
|
+
:param _request_timeout: timeout setting for this request. If one
|
739
|
+
number provided, it will be total request
|
740
|
+
timeout. It can also be a pair (tuple) of
|
741
|
+
(connection, read) timeouts.
|
742
|
+
:type _request_timeout: int, tuple(int, int), optional
|
743
|
+
:param _request_auth: set to override the auth_settings for an a single
|
744
|
+
request; this effectively ignores the
|
745
|
+
authentication in the spec for a single request.
|
746
|
+
:type _request_auth: dict, optional
|
747
|
+
:param _content_type: force content-type for the request.
|
748
|
+
:type _content_type: str, Optional
|
749
|
+
:param _headers: set to override the headers for a single
|
750
|
+
request; this effectively ignores the headers
|
751
|
+
in the spec for a single request.
|
752
|
+
:type _headers: dict, optional
|
753
|
+
:param _host_index: set to override the host_index for a single
|
754
|
+
request; this effectively ignores the host_index
|
755
|
+
in the spec for a single request.
|
756
|
+
:type _host_index: int, optional
|
757
|
+
:return: Returns the result object.
|
758
|
+
""" # noqa: E501
|
759
|
+
|
760
|
+
_param = self._free_text_relation_extraction_task_read_settings_serialize(
|
761
|
+
username=username,
|
762
|
+
dataset=dataset,
|
763
|
+
q_answer_api_key=q_answer_api_key,
|
764
|
+
_request_auth=_request_auth,
|
765
|
+
_content_type=_content_type,
|
766
|
+
_headers=_headers,
|
767
|
+
_host_index=_host_index
|
768
|
+
)
|
769
|
+
|
770
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
771
|
+
'200': "RelationExtractionTaskSettings",
|
772
|
+
}
|
773
|
+
response_data = self.api_client.call_api(
|
774
|
+
*_param,
|
775
|
+
_request_timeout=_request_timeout
|
776
|
+
)
|
777
|
+
response_data.read()
|
778
|
+
return self.api_client.response_deserialize(
|
779
|
+
response_data=response_data,
|
780
|
+
response_types_map=_response_types_map,
|
781
|
+
)
|
782
|
+
|
783
|
+
|
784
|
+
@validate_call
|
785
|
+
def free_text_relation_extraction_task_read_settings_without_preload_content(
|
786
|
+
self,
|
787
|
+
username: StrictStr,
|
788
|
+
dataset: StrictStr,
|
789
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
790
|
+
_request_timeout: Union[
|
791
|
+
None,
|
792
|
+
Annotated[StrictFloat, Field(gt=0)],
|
793
|
+
Tuple[
|
794
|
+
Annotated[StrictFloat, Field(gt=0)],
|
795
|
+
Annotated[StrictFloat, Field(gt=0)]
|
796
|
+
]
|
797
|
+
] = None,
|
798
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
799
|
+
_content_type: Optional[StrictStr] = None,
|
800
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
801
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
802
|
+
) -> RESTResponseType:
|
803
|
+
"""This reads the settings of the relation-extraction task
|
804
|
+
|
805
|
+
|
806
|
+
:param username: (required)
|
807
|
+
:type username: str
|
808
|
+
:param dataset: (required)
|
809
|
+
:type dataset: str
|
810
|
+
:param q_answer_api_key:
|
811
|
+
:type q_answer_api_key: str
|
812
|
+
:param _request_timeout: timeout setting for this request. If one
|
813
|
+
number provided, it will be total request
|
814
|
+
timeout. It can also be a pair (tuple) of
|
815
|
+
(connection, read) timeouts.
|
816
|
+
:type _request_timeout: int, tuple(int, int), optional
|
817
|
+
:param _request_auth: set to override the auth_settings for an a single
|
818
|
+
request; this effectively ignores the
|
819
|
+
authentication in the spec for a single request.
|
820
|
+
:type _request_auth: dict, optional
|
821
|
+
:param _content_type: force content-type for the request.
|
822
|
+
:type _content_type: str, Optional
|
823
|
+
:param _headers: set to override the headers for a single
|
824
|
+
request; this effectively ignores the headers
|
825
|
+
in the spec for a single request.
|
826
|
+
:type _headers: dict, optional
|
827
|
+
:param _host_index: set to override the host_index for a single
|
828
|
+
request; this effectively ignores the host_index
|
829
|
+
in the spec for a single request.
|
830
|
+
:type _host_index: int, optional
|
831
|
+
:return: Returns the result object.
|
832
|
+
""" # noqa: E501
|
833
|
+
|
834
|
+
_param = self._free_text_relation_extraction_task_read_settings_serialize(
|
835
|
+
username=username,
|
836
|
+
dataset=dataset,
|
837
|
+
q_answer_api_key=q_answer_api_key,
|
838
|
+
_request_auth=_request_auth,
|
839
|
+
_content_type=_content_type,
|
840
|
+
_headers=_headers,
|
841
|
+
_host_index=_host_index
|
842
|
+
)
|
843
|
+
|
844
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
845
|
+
'200': "RelationExtractionTaskSettings",
|
846
|
+
}
|
847
|
+
response_data = self.api_client.call_api(
|
848
|
+
*_param,
|
849
|
+
_request_timeout=_request_timeout
|
850
|
+
)
|
851
|
+
return response_data.response
|
852
|
+
|
853
|
+
|
854
|
+
def _free_text_relation_extraction_task_read_settings_serialize(
|
855
|
+
self,
|
856
|
+
username,
|
857
|
+
dataset,
|
858
|
+
q_answer_api_key,
|
859
|
+
_request_auth,
|
860
|
+
_content_type,
|
861
|
+
_headers,
|
862
|
+
_host_index,
|
863
|
+
) -> RequestSerialized:
|
864
|
+
|
865
|
+
_host = None
|
866
|
+
|
867
|
+
_collection_formats: Dict[str, str] = {
|
868
|
+
}
|
869
|
+
|
870
|
+
_path_params: Dict[str, str] = {}
|
871
|
+
_query_params: List[Tuple[str, str]] = []
|
872
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
873
|
+
_form_params: List[Tuple[str, str]] = []
|
874
|
+
_files: Dict[
|
875
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
876
|
+
] = {}
|
877
|
+
_body_params: Optional[bytes] = None
|
878
|
+
|
879
|
+
# process the path parameters
|
880
|
+
# process the query parameters
|
881
|
+
if username is not None:
|
882
|
+
|
883
|
+
_query_params.append(('username', username))
|
884
|
+
|
885
|
+
if dataset is not None:
|
886
|
+
|
887
|
+
_query_params.append(('dataset', dataset))
|
888
|
+
|
889
|
+
# process the header parameters
|
890
|
+
if q_answer_api_key is not None:
|
891
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
892
|
+
# process the form parameters
|
893
|
+
# process the body parameter
|
894
|
+
|
895
|
+
|
896
|
+
# set the HTTP header `Accept`
|
897
|
+
if 'Accept' not in _header_params:
|
898
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
899
|
+
[
|
900
|
+
'*/*'
|
901
|
+
]
|
902
|
+
)
|
903
|
+
|
904
|
+
|
905
|
+
# authentication setting
|
906
|
+
_auth_settings: List[str] = [
|
907
|
+
'QAnswer-Api-Key',
|
908
|
+
'Bearer'
|
909
|
+
]
|
910
|
+
|
911
|
+
return self.api_client.param_serialize(
|
912
|
+
method='GET',
|
913
|
+
resource_path='/api/tasks/relation-extraction/settings',
|
914
|
+
path_params=_path_params,
|
915
|
+
query_params=_query_params,
|
916
|
+
header_params=_header_params,
|
917
|
+
body=_body_params,
|
918
|
+
post_params=_form_params,
|
919
|
+
files=_files,
|
920
|
+
auth_settings=_auth_settings,
|
921
|
+
collection_formats=_collection_formats,
|
922
|
+
_host=_host,
|
923
|
+
_request_auth=_request_auth
|
924
|
+
)
|
925
|
+
|
926
|
+
|
927
|
+
|
928
|
+
|
929
|
+
@validate_call
|
930
|
+
def free_text_relation_extraction_task_update_settings(
|
931
|
+
self,
|
932
|
+
relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload,
|
933
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
934
|
+
_request_timeout: Union[
|
935
|
+
None,
|
936
|
+
Annotated[StrictFloat, Field(gt=0)],
|
937
|
+
Tuple[
|
938
|
+
Annotated[StrictFloat, Field(gt=0)],
|
939
|
+
Annotated[StrictFloat, Field(gt=0)]
|
940
|
+
]
|
941
|
+
] = None,
|
942
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
943
|
+
_content_type: Optional[StrictStr] = None,
|
944
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
945
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
946
|
+
) -> RelationExtractionTaskSettings:
|
947
|
+
"""This updates the settings of the relation-extraction task
|
948
|
+
|
949
|
+
|
950
|
+
:param relation_extraction_task_settings_update_payload: (required)
|
951
|
+
:type relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload
|
952
|
+
:param q_answer_api_key:
|
953
|
+
:type q_answer_api_key: str
|
954
|
+
:param _request_timeout: timeout setting for this request. If one
|
955
|
+
number provided, it will be total request
|
956
|
+
timeout. It can also be a pair (tuple) of
|
957
|
+
(connection, read) timeouts.
|
958
|
+
:type _request_timeout: int, tuple(int, int), optional
|
959
|
+
:param _request_auth: set to override the auth_settings for an a single
|
960
|
+
request; this effectively ignores the
|
961
|
+
authentication in the spec for a single request.
|
962
|
+
:type _request_auth: dict, optional
|
963
|
+
:param _content_type: force content-type for the request.
|
964
|
+
:type _content_type: str, Optional
|
965
|
+
:param _headers: set to override the headers for a single
|
966
|
+
request; this effectively ignores the headers
|
967
|
+
in the spec for a single request.
|
968
|
+
:type _headers: dict, optional
|
969
|
+
:param _host_index: set to override the host_index for a single
|
970
|
+
request; this effectively ignores the host_index
|
971
|
+
in the spec for a single request.
|
972
|
+
:type _host_index: int, optional
|
973
|
+
:return: Returns the result object.
|
974
|
+
""" # noqa: E501
|
975
|
+
|
976
|
+
_param = self._free_text_relation_extraction_task_update_settings_serialize(
|
977
|
+
relation_extraction_task_settings_update_payload=relation_extraction_task_settings_update_payload,
|
978
|
+
q_answer_api_key=q_answer_api_key,
|
979
|
+
_request_auth=_request_auth,
|
980
|
+
_content_type=_content_type,
|
981
|
+
_headers=_headers,
|
982
|
+
_host_index=_host_index
|
983
|
+
)
|
984
|
+
|
985
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
986
|
+
'200': "RelationExtractionTaskSettings",
|
987
|
+
}
|
988
|
+
response_data = self.api_client.call_api(
|
989
|
+
*_param,
|
990
|
+
_request_timeout=_request_timeout
|
991
|
+
)
|
992
|
+
response_data.read()
|
993
|
+
return self.api_client.response_deserialize(
|
994
|
+
response_data=response_data,
|
995
|
+
response_types_map=_response_types_map,
|
996
|
+
).data
|
997
|
+
|
998
|
+
|
999
|
+
@validate_call
|
1000
|
+
def free_text_relation_extraction_task_update_settings_with_http_info(
|
1001
|
+
self,
|
1002
|
+
relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload,
|
1003
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1004
|
+
_request_timeout: Union[
|
1005
|
+
None,
|
1006
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1007
|
+
Tuple[
|
1008
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1009
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1010
|
+
]
|
1011
|
+
] = None,
|
1012
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1013
|
+
_content_type: Optional[StrictStr] = None,
|
1014
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1015
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1016
|
+
) -> ApiResponse[RelationExtractionTaskSettings]:
|
1017
|
+
"""This updates the settings of the relation-extraction task
|
1018
|
+
|
1019
|
+
|
1020
|
+
:param relation_extraction_task_settings_update_payload: (required)
|
1021
|
+
:type relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload
|
1022
|
+
:param q_answer_api_key:
|
1023
|
+
:type q_answer_api_key: str
|
1024
|
+
:param _request_timeout: timeout setting for this request. If one
|
1025
|
+
number provided, it will be total request
|
1026
|
+
timeout. It can also be a pair (tuple) of
|
1027
|
+
(connection, read) timeouts.
|
1028
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1029
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1030
|
+
request; this effectively ignores the
|
1031
|
+
authentication in the spec for a single request.
|
1032
|
+
:type _request_auth: dict, optional
|
1033
|
+
:param _content_type: force content-type for the request.
|
1034
|
+
:type _content_type: str, Optional
|
1035
|
+
:param _headers: set to override the headers for a single
|
1036
|
+
request; this effectively ignores the headers
|
1037
|
+
in the spec for a single request.
|
1038
|
+
:type _headers: dict, optional
|
1039
|
+
:param _host_index: set to override the host_index for a single
|
1040
|
+
request; this effectively ignores the host_index
|
1041
|
+
in the spec for a single request.
|
1042
|
+
:type _host_index: int, optional
|
1043
|
+
:return: Returns the result object.
|
1044
|
+
""" # noqa: E501
|
1045
|
+
|
1046
|
+
_param = self._free_text_relation_extraction_task_update_settings_serialize(
|
1047
|
+
relation_extraction_task_settings_update_payload=relation_extraction_task_settings_update_payload,
|
1048
|
+
q_answer_api_key=q_answer_api_key,
|
1049
|
+
_request_auth=_request_auth,
|
1050
|
+
_content_type=_content_type,
|
1051
|
+
_headers=_headers,
|
1052
|
+
_host_index=_host_index
|
1053
|
+
)
|
1054
|
+
|
1055
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1056
|
+
'200': "RelationExtractionTaskSettings",
|
1057
|
+
}
|
1058
|
+
response_data = self.api_client.call_api(
|
1059
|
+
*_param,
|
1060
|
+
_request_timeout=_request_timeout
|
1061
|
+
)
|
1062
|
+
response_data.read()
|
1063
|
+
return self.api_client.response_deserialize(
|
1064
|
+
response_data=response_data,
|
1065
|
+
response_types_map=_response_types_map,
|
1066
|
+
)
|
1067
|
+
|
1068
|
+
|
1069
|
+
@validate_call
|
1070
|
+
def free_text_relation_extraction_task_update_settings_without_preload_content(
|
1071
|
+
self,
|
1072
|
+
relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload,
|
1073
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1074
|
+
_request_timeout: Union[
|
1075
|
+
None,
|
1076
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1077
|
+
Tuple[
|
1078
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1079
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1080
|
+
]
|
1081
|
+
] = None,
|
1082
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1083
|
+
_content_type: Optional[StrictStr] = None,
|
1084
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1085
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1086
|
+
) -> RESTResponseType:
|
1087
|
+
"""This updates the settings of the relation-extraction task
|
1088
|
+
|
1089
|
+
|
1090
|
+
:param relation_extraction_task_settings_update_payload: (required)
|
1091
|
+
:type relation_extraction_task_settings_update_payload: RelationExtractionTaskSettingsUpdatePayload
|
1092
|
+
:param q_answer_api_key:
|
1093
|
+
:type q_answer_api_key: str
|
1094
|
+
:param _request_timeout: timeout setting for this request. If one
|
1095
|
+
number provided, it will be total request
|
1096
|
+
timeout. It can also be a pair (tuple) of
|
1097
|
+
(connection, read) timeouts.
|
1098
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1099
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1100
|
+
request; this effectively ignores the
|
1101
|
+
authentication in the spec for a single request.
|
1102
|
+
:type _request_auth: dict, optional
|
1103
|
+
:param _content_type: force content-type for the request.
|
1104
|
+
:type _content_type: str, Optional
|
1105
|
+
:param _headers: set to override the headers for a single
|
1106
|
+
request; this effectively ignores the headers
|
1107
|
+
in the spec for a single request.
|
1108
|
+
:type _headers: dict, optional
|
1109
|
+
:param _host_index: set to override the host_index for a single
|
1110
|
+
request; this effectively ignores the host_index
|
1111
|
+
in the spec for a single request.
|
1112
|
+
:type _host_index: int, optional
|
1113
|
+
:return: Returns the result object.
|
1114
|
+
""" # noqa: E501
|
1115
|
+
|
1116
|
+
_param = self._free_text_relation_extraction_task_update_settings_serialize(
|
1117
|
+
relation_extraction_task_settings_update_payload=relation_extraction_task_settings_update_payload,
|
1118
|
+
q_answer_api_key=q_answer_api_key,
|
1119
|
+
_request_auth=_request_auth,
|
1120
|
+
_content_type=_content_type,
|
1121
|
+
_headers=_headers,
|
1122
|
+
_host_index=_host_index
|
1123
|
+
)
|
1124
|
+
|
1125
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1126
|
+
'200': "RelationExtractionTaskSettings",
|
1127
|
+
}
|
1128
|
+
response_data = self.api_client.call_api(
|
1129
|
+
*_param,
|
1130
|
+
_request_timeout=_request_timeout
|
1131
|
+
)
|
1132
|
+
return response_data.response
|
1133
|
+
|
1134
|
+
|
1135
|
+
def _free_text_relation_extraction_task_update_settings_serialize(
|
1136
|
+
self,
|
1137
|
+
relation_extraction_task_settings_update_payload,
|
1138
|
+
q_answer_api_key,
|
1139
|
+
_request_auth,
|
1140
|
+
_content_type,
|
1141
|
+
_headers,
|
1142
|
+
_host_index,
|
1143
|
+
) -> RequestSerialized:
|
1144
|
+
|
1145
|
+
_host = None
|
1146
|
+
|
1147
|
+
_collection_formats: Dict[str, str] = {
|
1148
|
+
}
|
1149
|
+
|
1150
|
+
_path_params: Dict[str, str] = {}
|
1151
|
+
_query_params: List[Tuple[str, str]] = []
|
1152
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1153
|
+
_form_params: List[Tuple[str, str]] = []
|
1154
|
+
_files: Dict[
|
1155
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1156
|
+
] = {}
|
1157
|
+
_body_params: Optional[bytes] = None
|
1158
|
+
|
1159
|
+
# process the path parameters
|
1160
|
+
# process the query parameters
|
1161
|
+
# process the header parameters
|
1162
|
+
if q_answer_api_key is not None:
|
1163
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
1164
|
+
# process the form parameters
|
1165
|
+
# process the body parameter
|
1166
|
+
if relation_extraction_task_settings_update_payload is not None:
|
1167
|
+
_body_params = relation_extraction_task_settings_update_payload
|
1168
|
+
|
1169
|
+
|
1170
|
+
# set the HTTP header `Accept`
|
1171
|
+
if 'Accept' not in _header_params:
|
1172
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1173
|
+
[
|
1174
|
+
'*/*'
|
1175
|
+
]
|
1176
|
+
)
|
1177
|
+
|
1178
|
+
# set the HTTP header `Content-Type`
|
1179
|
+
if _content_type:
|
1180
|
+
_header_params['Content-Type'] = _content_type
|
1181
|
+
else:
|
1182
|
+
_default_content_type = (
|
1183
|
+
self.api_client.select_header_content_type(
|
1184
|
+
[
|
1185
|
+
'application/json'
|
1186
|
+
]
|
1187
|
+
)
|
1188
|
+
)
|
1189
|
+
if _default_content_type is not None:
|
1190
|
+
_header_params['Content-Type'] = _default_content_type
|
1191
|
+
|
1192
|
+
# authentication setting
|
1193
|
+
_auth_settings: List[str] = [
|
1194
|
+
'QAnswer-Api-Key',
|
1195
|
+
'Bearer'
|
1196
|
+
]
|
1197
|
+
|
1198
|
+
return self.api_client.param_serialize(
|
1199
|
+
method='PUT',
|
1200
|
+
resource_path='/api/tasks/relation-extraction/settings',
|
1201
|
+
path_params=_path_params,
|
1202
|
+
query_params=_query_params,
|
1203
|
+
header_params=_header_params,
|
1204
|
+
body=_body_params,
|
1205
|
+
post_params=_form_params,
|
1206
|
+
files=_files,
|
1207
|
+
auth_settings=_auth_settings,
|
1208
|
+
collection_formats=_collection_formats,
|
1209
|
+
_host=_host,
|
1210
|
+
_request_auth=_request_auth
|
1211
|
+
)
|
1212
|
+
|
1213
|
+
|
1214
|
+
|
1215
|
+
|
1216
|
+
@validate_call
|
1217
|
+
def free_text_summariser_relation_extraction(
|
1218
|
+
self,
|
1219
|
+
relation_extraction_payload: RelationExtractionPayload,
|
1220
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1221
|
+
_request_timeout: Union[
|
1222
|
+
None,
|
1223
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1224
|
+
Tuple[
|
1225
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1226
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1227
|
+
]
|
1228
|
+
] = None,
|
1229
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1230
|
+
_content_type: Optional[StrictStr] = None,
|
1231
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1232
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1233
|
+
) -> List[RelationExtractionResult]:
|
1234
|
+
"""Extracts relations over the underlying data
|
1235
|
+
|
1236
|
+
|
1237
|
+
:param relation_extraction_payload: (required)
|
1238
|
+
:type relation_extraction_payload: RelationExtractionPayload
|
1239
|
+
:param q_answer_api_key:
|
1240
|
+
:type q_answer_api_key: str
|
1241
|
+
:param _request_timeout: timeout setting for this request. If one
|
1242
|
+
number provided, it will be total request
|
1243
|
+
timeout. It can also be a pair (tuple) of
|
1244
|
+
(connection, read) timeouts.
|
1245
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1246
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1247
|
+
request; this effectively ignores the
|
1248
|
+
authentication in the spec for a single request.
|
1249
|
+
:type _request_auth: dict, optional
|
1250
|
+
:param _content_type: force content-type for the request.
|
1251
|
+
:type _content_type: str, Optional
|
1252
|
+
:param _headers: set to override the headers for a single
|
1253
|
+
request; this effectively ignores the headers
|
1254
|
+
in the spec for a single request.
|
1255
|
+
:type _headers: dict, optional
|
1256
|
+
:param _host_index: set to override the host_index for a single
|
1257
|
+
request; this effectively ignores the host_index
|
1258
|
+
in the spec for a single request.
|
1259
|
+
:type _host_index: int, optional
|
1260
|
+
:return: Returns the result object.
|
1261
|
+
""" # noqa: E501
|
1262
|
+
|
1263
|
+
_param = self._free_text_summariser_relation_extraction_serialize(
|
1264
|
+
relation_extraction_payload=relation_extraction_payload,
|
1265
|
+
q_answer_api_key=q_answer_api_key,
|
1266
|
+
_request_auth=_request_auth,
|
1267
|
+
_content_type=_content_type,
|
1268
|
+
_headers=_headers,
|
1269
|
+
_host_index=_host_index
|
1270
|
+
)
|
1271
|
+
|
1272
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1273
|
+
'200': "List[RelationExtractionResult]",
|
1274
|
+
}
|
1275
|
+
response_data = self.api_client.call_api(
|
1276
|
+
*_param,
|
1277
|
+
_request_timeout=_request_timeout
|
1278
|
+
)
|
1279
|
+
response_data.read()
|
1280
|
+
return self.api_client.response_deserialize(
|
1281
|
+
response_data=response_data,
|
1282
|
+
response_types_map=_response_types_map,
|
1283
|
+
).data
|
1284
|
+
|
1285
|
+
|
1286
|
+
@validate_call
|
1287
|
+
def free_text_summariser_relation_extraction_with_http_info(
|
1288
|
+
self,
|
1289
|
+
relation_extraction_payload: RelationExtractionPayload,
|
1290
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1291
|
+
_request_timeout: Union[
|
1292
|
+
None,
|
1293
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1294
|
+
Tuple[
|
1295
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1296
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1297
|
+
]
|
1298
|
+
] = None,
|
1299
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1300
|
+
_content_type: Optional[StrictStr] = None,
|
1301
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1302
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1303
|
+
) -> ApiResponse[List[RelationExtractionResult]]:
|
1304
|
+
"""Extracts relations over the underlying data
|
1305
|
+
|
1306
|
+
|
1307
|
+
:param relation_extraction_payload: (required)
|
1308
|
+
:type relation_extraction_payload: RelationExtractionPayload
|
1309
|
+
:param q_answer_api_key:
|
1310
|
+
:type q_answer_api_key: str
|
1311
|
+
:param _request_timeout: timeout setting for this request. If one
|
1312
|
+
number provided, it will be total request
|
1313
|
+
timeout. It can also be a pair (tuple) of
|
1314
|
+
(connection, read) timeouts.
|
1315
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1316
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1317
|
+
request; this effectively ignores the
|
1318
|
+
authentication in the spec for a single request.
|
1319
|
+
:type _request_auth: dict, optional
|
1320
|
+
:param _content_type: force content-type for the request.
|
1321
|
+
:type _content_type: str, Optional
|
1322
|
+
:param _headers: set to override the headers for a single
|
1323
|
+
request; this effectively ignores the headers
|
1324
|
+
in the spec for a single request.
|
1325
|
+
:type _headers: dict, optional
|
1326
|
+
:param _host_index: set to override the host_index for a single
|
1327
|
+
request; this effectively ignores the host_index
|
1328
|
+
in the spec for a single request.
|
1329
|
+
:type _host_index: int, optional
|
1330
|
+
:return: Returns the result object.
|
1331
|
+
""" # noqa: E501
|
1332
|
+
|
1333
|
+
_param = self._free_text_summariser_relation_extraction_serialize(
|
1334
|
+
relation_extraction_payload=relation_extraction_payload,
|
1335
|
+
q_answer_api_key=q_answer_api_key,
|
1336
|
+
_request_auth=_request_auth,
|
1337
|
+
_content_type=_content_type,
|
1338
|
+
_headers=_headers,
|
1339
|
+
_host_index=_host_index
|
1340
|
+
)
|
1341
|
+
|
1342
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1343
|
+
'200': "List[RelationExtractionResult]",
|
1344
|
+
}
|
1345
|
+
response_data = self.api_client.call_api(
|
1346
|
+
*_param,
|
1347
|
+
_request_timeout=_request_timeout
|
1348
|
+
)
|
1349
|
+
response_data.read()
|
1350
|
+
return self.api_client.response_deserialize(
|
1351
|
+
response_data=response_data,
|
1352
|
+
response_types_map=_response_types_map,
|
1353
|
+
)
|
1354
|
+
|
1355
|
+
|
1356
|
+
@validate_call
|
1357
|
+
def free_text_summariser_relation_extraction_without_preload_content(
|
1358
|
+
self,
|
1359
|
+
relation_extraction_payload: RelationExtractionPayload,
|
1360
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1361
|
+
_request_timeout: Union[
|
1362
|
+
None,
|
1363
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1364
|
+
Tuple[
|
1365
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1366
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1367
|
+
]
|
1368
|
+
] = None,
|
1369
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1370
|
+
_content_type: Optional[StrictStr] = None,
|
1371
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1372
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1373
|
+
) -> RESTResponseType:
|
1374
|
+
"""Extracts relations over the underlying data
|
1375
|
+
|
1376
|
+
|
1377
|
+
:param relation_extraction_payload: (required)
|
1378
|
+
:type relation_extraction_payload: RelationExtractionPayload
|
1379
|
+
:param q_answer_api_key:
|
1380
|
+
:type q_answer_api_key: str
|
1381
|
+
:param _request_timeout: timeout setting for this request. If one
|
1382
|
+
number provided, it will be total request
|
1383
|
+
timeout. It can also be a pair (tuple) of
|
1384
|
+
(connection, read) timeouts.
|
1385
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1386
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1387
|
+
request; this effectively ignores the
|
1388
|
+
authentication in the spec for a single request.
|
1389
|
+
:type _request_auth: dict, optional
|
1390
|
+
:param _content_type: force content-type for the request.
|
1391
|
+
:type _content_type: str, Optional
|
1392
|
+
:param _headers: set to override the headers for a single
|
1393
|
+
request; this effectively ignores the headers
|
1394
|
+
in the spec for a single request.
|
1395
|
+
:type _headers: dict, optional
|
1396
|
+
:param _host_index: set to override the host_index for a single
|
1397
|
+
request; this effectively ignores the host_index
|
1398
|
+
in the spec for a single request.
|
1399
|
+
:type _host_index: int, optional
|
1400
|
+
:return: Returns the result object.
|
1401
|
+
""" # noqa: E501
|
1402
|
+
|
1403
|
+
_param = self._free_text_summariser_relation_extraction_serialize(
|
1404
|
+
relation_extraction_payload=relation_extraction_payload,
|
1405
|
+
q_answer_api_key=q_answer_api_key,
|
1406
|
+
_request_auth=_request_auth,
|
1407
|
+
_content_type=_content_type,
|
1408
|
+
_headers=_headers,
|
1409
|
+
_host_index=_host_index
|
1410
|
+
)
|
1411
|
+
|
1412
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1413
|
+
'200': "List[RelationExtractionResult]",
|
1414
|
+
}
|
1415
|
+
response_data = self.api_client.call_api(
|
1416
|
+
*_param,
|
1417
|
+
_request_timeout=_request_timeout
|
1418
|
+
)
|
1419
|
+
return response_data.response
|
1420
|
+
|
1421
|
+
|
1422
|
+
def _free_text_summariser_relation_extraction_serialize(
|
1423
|
+
self,
|
1424
|
+
relation_extraction_payload,
|
1425
|
+
q_answer_api_key,
|
1426
|
+
_request_auth,
|
1427
|
+
_content_type,
|
1428
|
+
_headers,
|
1429
|
+
_host_index,
|
1430
|
+
) -> RequestSerialized:
|
1431
|
+
|
1432
|
+
_host = None
|
1433
|
+
|
1434
|
+
_collection_formats: Dict[str, str] = {
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
_path_params: Dict[str, str] = {}
|
1438
|
+
_query_params: List[Tuple[str, str]] = []
|
1439
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1440
|
+
_form_params: List[Tuple[str, str]] = []
|
1441
|
+
_files: Dict[
|
1442
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1443
|
+
] = {}
|
1444
|
+
_body_params: Optional[bytes] = None
|
1445
|
+
|
1446
|
+
# process the path parameters
|
1447
|
+
# process the query parameters
|
1448
|
+
# process the header parameters
|
1449
|
+
if q_answer_api_key is not None:
|
1450
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
1451
|
+
# process the form parameters
|
1452
|
+
# process the body parameter
|
1453
|
+
if relation_extraction_payload is not None:
|
1454
|
+
_body_params = relation_extraction_payload
|
1455
|
+
|
1456
|
+
|
1457
|
+
# set the HTTP header `Accept`
|
1458
|
+
if 'Accept' not in _header_params:
|
1459
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1460
|
+
[
|
1461
|
+
'*/*'
|
1462
|
+
]
|
1463
|
+
)
|
1464
|
+
|
1465
|
+
# set the HTTP header `Content-Type`
|
1466
|
+
if _content_type:
|
1467
|
+
_header_params['Content-Type'] = _content_type
|
1468
|
+
else:
|
1469
|
+
_default_content_type = (
|
1470
|
+
self.api_client.select_header_content_type(
|
1471
|
+
[
|
1472
|
+
'application/json'
|
1473
|
+
]
|
1474
|
+
)
|
1475
|
+
)
|
1476
|
+
if _default_content_type is not None:
|
1477
|
+
_header_params['Content-Type'] = _default_content_type
|
1478
|
+
|
1479
|
+
# authentication setting
|
1480
|
+
_auth_settings: List[str] = [
|
1481
|
+
'QAnswer-Api-Key',
|
1482
|
+
'Bearer'
|
1483
|
+
]
|
1484
|
+
|
1485
|
+
return self.api_client.param_serialize(
|
1486
|
+
method='POST',
|
1487
|
+
resource_path='/api/tasks/relation-extraction',
|
1488
|
+
path_params=_path_params,
|
1489
|
+
query_params=_query_params,
|
1490
|
+
header_params=_header_params,
|
1491
|
+
body=_body_params,
|
1492
|
+
post_params=_form_params,
|
1493
|
+
files=_files,
|
1494
|
+
auth_settings=_auth_settings,
|
1495
|
+
collection_formats=_collection_formats,
|
1496
|
+
_host=_host,
|
1497
|
+
_request_auth=_request_auth
|
1498
|
+
)
|
1499
|
+
|
1500
|
+
|
1501
|
+
|
1502
|
+
|
1503
|
+
@validate_call
|
1504
|
+
def free_text_summariser_relation_extraction_export_schema(
|
1505
|
+
self,
|
1506
|
+
relation_extraction_configuration: RelationExtractionConfiguration,
|
1507
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1508
|
+
_request_timeout: Union[
|
1509
|
+
None,
|
1510
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1511
|
+
Tuple[
|
1512
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1513
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1514
|
+
]
|
1515
|
+
] = None,
|
1516
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1517
|
+
_content_type: Optional[StrictStr] = None,
|
1518
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1519
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1520
|
+
) -> bytearray:
|
1521
|
+
"""Exports the schema for relation extraction
|
1522
|
+
|
1523
|
+
|
1524
|
+
:param relation_extraction_configuration: (required)
|
1525
|
+
:type relation_extraction_configuration: RelationExtractionConfiguration
|
1526
|
+
:param q_answer_api_key:
|
1527
|
+
:type q_answer_api_key: str
|
1528
|
+
:param _request_timeout: timeout setting for this request. If one
|
1529
|
+
number provided, it will be total request
|
1530
|
+
timeout. It can also be a pair (tuple) of
|
1531
|
+
(connection, read) timeouts.
|
1532
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1533
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1534
|
+
request; this effectively ignores the
|
1535
|
+
authentication in the spec for a single request.
|
1536
|
+
:type _request_auth: dict, optional
|
1537
|
+
:param _content_type: force content-type for the request.
|
1538
|
+
:type _content_type: str, Optional
|
1539
|
+
:param _headers: set to override the headers for a single
|
1540
|
+
request; this effectively ignores the headers
|
1541
|
+
in the spec for a single request.
|
1542
|
+
:type _headers: dict, optional
|
1543
|
+
:param _host_index: set to override the host_index for a single
|
1544
|
+
request; this effectively ignores the host_index
|
1545
|
+
in the spec for a single request.
|
1546
|
+
:type _host_index: int, optional
|
1547
|
+
:return: Returns the result object.
|
1548
|
+
""" # noqa: E501
|
1549
|
+
|
1550
|
+
_param = self._free_text_summariser_relation_extraction_export_schema_serialize(
|
1551
|
+
relation_extraction_configuration=relation_extraction_configuration,
|
1552
|
+
q_answer_api_key=q_answer_api_key,
|
1553
|
+
_request_auth=_request_auth,
|
1554
|
+
_content_type=_content_type,
|
1555
|
+
_headers=_headers,
|
1556
|
+
_host_index=_host_index
|
1557
|
+
)
|
1558
|
+
|
1559
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1560
|
+
'200': "bytearray",
|
1561
|
+
}
|
1562
|
+
response_data = self.api_client.call_api(
|
1563
|
+
*_param,
|
1564
|
+
_request_timeout=_request_timeout
|
1565
|
+
)
|
1566
|
+
response_data.read()
|
1567
|
+
return self.api_client.response_deserialize(
|
1568
|
+
response_data=response_data,
|
1569
|
+
response_types_map=_response_types_map,
|
1570
|
+
).data
|
1571
|
+
|
1572
|
+
|
1573
|
+
@validate_call
|
1574
|
+
def free_text_summariser_relation_extraction_export_schema_with_http_info(
|
1575
|
+
self,
|
1576
|
+
relation_extraction_configuration: RelationExtractionConfiguration,
|
1577
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1578
|
+
_request_timeout: Union[
|
1579
|
+
None,
|
1580
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1581
|
+
Tuple[
|
1582
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1583
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1584
|
+
]
|
1585
|
+
] = None,
|
1586
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1587
|
+
_content_type: Optional[StrictStr] = None,
|
1588
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1589
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1590
|
+
) -> ApiResponse[bytearray]:
|
1591
|
+
"""Exports the schema for relation extraction
|
1592
|
+
|
1593
|
+
|
1594
|
+
:param relation_extraction_configuration: (required)
|
1595
|
+
:type relation_extraction_configuration: RelationExtractionConfiguration
|
1596
|
+
:param q_answer_api_key:
|
1597
|
+
:type q_answer_api_key: str
|
1598
|
+
:param _request_timeout: timeout setting for this request. If one
|
1599
|
+
number provided, it will be total request
|
1600
|
+
timeout. It can also be a pair (tuple) of
|
1601
|
+
(connection, read) timeouts.
|
1602
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1603
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1604
|
+
request; this effectively ignores the
|
1605
|
+
authentication in the spec for a single request.
|
1606
|
+
:type _request_auth: dict, optional
|
1607
|
+
:param _content_type: force content-type for the request.
|
1608
|
+
:type _content_type: str, Optional
|
1609
|
+
:param _headers: set to override the headers for a single
|
1610
|
+
request; this effectively ignores the headers
|
1611
|
+
in the spec for a single request.
|
1612
|
+
:type _headers: dict, optional
|
1613
|
+
:param _host_index: set to override the host_index for a single
|
1614
|
+
request; this effectively ignores the host_index
|
1615
|
+
in the spec for a single request.
|
1616
|
+
:type _host_index: int, optional
|
1617
|
+
:return: Returns the result object.
|
1618
|
+
""" # noqa: E501
|
1619
|
+
|
1620
|
+
_param = self._free_text_summariser_relation_extraction_export_schema_serialize(
|
1621
|
+
relation_extraction_configuration=relation_extraction_configuration,
|
1622
|
+
q_answer_api_key=q_answer_api_key,
|
1623
|
+
_request_auth=_request_auth,
|
1624
|
+
_content_type=_content_type,
|
1625
|
+
_headers=_headers,
|
1626
|
+
_host_index=_host_index
|
1627
|
+
)
|
1628
|
+
|
1629
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1630
|
+
'200': "bytearray",
|
1631
|
+
}
|
1632
|
+
response_data = self.api_client.call_api(
|
1633
|
+
*_param,
|
1634
|
+
_request_timeout=_request_timeout
|
1635
|
+
)
|
1636
|
+
response_data.read()
|
1637
|
+
return self.api_client.response_deserialize(
|
1638
|
+
response_data=response_data,
|
1639
|
+
response_types_map=_response_types_map,
|
1640
|
+
)
|
1641
|
+
|
1642
|
+
|
1643
|
+
@validate_call
|
1644
|
+
def free_text_summariser_relation_extraction_export_schema_without_preload_content(
|
1645
|
+
self,
|
1646
|
+
relation_extraction_configuration: RelationExtractionConfiguration,
|
1647
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1648
|
+
_request_timeout: Union[
|
1649
|
+
None,
|
1650
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1651
|
+
Tuple[
|
1652
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1653
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1654
|
+
]
|
1655
|
+
] = None,
|
1656
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1657
|
+
_content_type: Optional[StrictStr] = None,
|
1658
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1659
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1660
|
+
) -> RESTResponseType:
|
1661
|
+
"""Exports the schema for relation extraction
|
1662
|
+
|
1663
|
+
|
1664
|
+
:param relation_extraction_configuration: (required)
|
1665
|
+
:type relation_extraction_configuration: RelationExtractionConfiguration
|
1666
|
+
:param q_answer_api_key:
|
1667
|
+
:type q_answer_api_key: str
|
1668
|
+
:param _request_timeout: timeout setting for this request. If one
|
1669
|
+
number provided, it will be total request
|
1670
|
+
timeout. It can also be a pair (tuple) of
|
1671
|
+
(connection, read) timeouts.
|
1672
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1673
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1674
|
+
request; this effectively ignores the
|
1675
|
+
authentication in the spec for a single request.
|
1676
|
+
:type _request_auth: dict, optional
|
1677
|
+
:param _content_type: force content-type for the request.
|
1678
|
+
:type _content_type: str, Optional
|
1679
|
+
:param _headers: set to override the headers for a single
|
1680
|
+
request; this effectively ignores the headers
|
1681
|
+
in the spec for a single request.
|
1682
|
+
:type _headers: dict, optional
|
1683
|
+
:param _host_index: set to override the host_index for a single
|
1684
|
+
request; this effectively ignores the host_index
|
1685
|
+
in the spec for a single request.
|
1686
|
+
:type _host_index: int, optional
|
1687
|
+
:return: Returns the result object.
|
1688
|
+
""" # noqa: E501
|
1689
|
+
|
1690
|
+
_param = self._free_text_summariser_relation_extraction_export_schema_serialize(
|
1691
|
+
relation_extraction_configuration=relation_extraction_configuration,
|
1692
|
+
q_answer_api_key=q_answer_api_key,
|
1693
|
+
_request_auth=_request_auth,
|
1694
|
+
_content_type=_content_type,
|
1695
|
+
_headers=_headers,
|
1696
|
+
_host_index=_host_index
|
1697
|
+
)
|
1698
|
+
|
1699
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1700
|
+
'200': "bytearray",
|
1701
|
+
}
|
1702
|
+
response_data = self.api_client.call_api(
|
1703
|
+
*_param,
|
1704
|
+
_request_timeout=_request_timeout
|
1705
|
+
)
|
1706
|
+
return response_data.response
|
1707
|
+
|
1708
|
+
|
1709
|
+
def _free_text_summariser_relation_extraction_export_schema_serialize(
|
1710
|
+
self,
|
1711
|
+
relation_extraction_configuration,
|
1712
|
+
q_answer_api_key,
|
1713
|
+
_request_auth,
|
1714
|
+
_content_type,
|
1715
|
+
_headers,
|
1716
|
+
_host_index,
|
1717
|
+
) -> RequestSerialized:
|
1718
|
+
|
1719
|
+
_host = None
|
1720
|
+
|
1721
|
+
_collection_formats: Dict[str, str] = {
|
1722
|
+
}
|
1723
|
+
|
1724
|
+
_path_params: Dict[str, str] = {}
|
1725
|
+
_query_params: List[Tuple[str, str]] = []
|
1726
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1727
|
+
_form_params: List[Tuple[str, str]] = []
|
1728
|
+
_files: Dict[
|
1729
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1730
|
+
] = {}
|
1731
|
+
_body_params: Optional[bytes] = None
|
1732
|
+
|
1733
|
+
# process the path parameters
|
1734
|
+
# process the query parameters
|
1735
|
+
# process the header parameters
|
1736
|
+
if q_answer_api_key is not None:
|
1737
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
1738
|
+
# process the form parameters
|
1739
|
+
# process the body parameter
|
1740
|
+
if relation_extraction_configuration is not None:
|
1741
|
+
_body_params = relation_extraction_configuration
|
1742
|
+
|
1743
|
+
|
1744
|
+
# set the HTTP header `Accept`
|
1745
|
+
if 'Accept' not in _header_params:
|
1746
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1747
|
+
[
|
1748
|
+
'*/*'
|
1749
|
+
]
|
1750
|
+
)
|
1751
|
+
|
1752
|
+
# set the HTTP header `Content-Type`
|
1753
|
+
if _content_type:
|
1754
|
+
_header_params['Content-Type'] = _content_type
|
1755
|
+
else:
|
1756
|
+
_default_content_type = (
|
1757
|
+
self.api_client.select_header_content_type(
|
1758
|
+
[
|
1759
|
+
'application/json'
|
1760
|
+
]
|
1761
|
+
)
|
1762
|
+
)
|
1763
|
+
if _default_content_type is not None:
|
1764
|
+
_header_params['Content-Type'] = _default_content_type
|
1765
|
+
|
1766
|
+
# authentication setting
|
1767
|
+
_auth_settings: List[str] = [
|
1768
|
+
'QAnswer-Api-Key',
|
1769
|
+
'Bearer'
|
1770
|
+
]
|
1771
|
+
|
1772
|
+
return self.api_client.param_serialize(
|
1773
|
+
method='POST',
|
1774
|
+
resource_path='/api/tasks/relation-extraction/export-schema',
|
1775
|
+
path_params=_path_params,
|
1776
|
+
query_params=_query_params,
|
1777
|
+
header_params=_header_params,
|
1778
|
+
body=_body_params,
|
1779
|
+
post_params=_form_params,
|
1780
|
+
files=_files,
|
1781
|
+
auth_settings=_auth_settings,
|
1782
|
+
collection_formats=_collection_formats,
|
1783
|
+
_host=_host,
|
1784
|
+
_request_auth=_request_auth
|
1785
|
+
)
|
1786
|
+
|
1787
|
+
|
1788
|
+
|
1789
|
+
|
1790
|
+
@validate_call
|
1791
|
+
def free_text_summariser_relation_extraction_import_schema(
|
1792
|
+
self,
|
1793
|
+
file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
|
1794
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1795
|
+
_request_timeout: Union[
|
1796
|
+
None,
|
1797
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1798
|
+
Tuple[
|
1799
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1800
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1801
|
+
]
|
1802
|
+
] = None,
|
1803
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1804
|
+
_content_type: Optional[StrictStr] = None,
|
1805
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1806
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1807
|
+
) -> RelationExtractionConfiguration:
|
1808
|
+
"""Exports the schema for relation extraction
|
1809
|
+
|
1810
|
+
|
1811
|
+
:param file: (required)
|
1812
|
+
:type file: bytearray
|
1813
|
+
:param q_answer_api_key:
|
1814
|
+
:type q_answer_api_key: str
|
1815
|
+
:param _request_timeout: timeout setting for this request. If one
|
1816
|
+
number provided, it will be total request
|
1817
|
+
timeout. It can also be a pair (tuple) of
|
1818
|
+
(connection, read) timeouts.
|
1819
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1820
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1821
|
+
request; this effectively ignores the
|
1822
|
+
authentication in the spec for a single request.
|
1823
|
+
:type _request_auth: dict, optional
|
1824
|
+
:param _content_type: force content-type for the request.
|
1825
|
+
:type _content_type: str, Optional
|
1826
|
+
:param _headers: set to override the headers for a single
|
1827
|
+
request; this effectively ignores the headers
|
1828
|
+
in the spec for a single request.
|
1829
|
+
:type _headers: dict, optional
|
1830
|
+
:param _host_index: set to override the host_index for a single
|
1831
|
+
request; this effectively ignores the host_index
|
1832
|
+
in the spec for a single request.
|
1833
|
+
:type _host_index: int, optional
|
1834
|
+
:return: Returns the result object.
|
1835
|
+
""" # noqa: E501
|
1836
|
+
|
1837
|
+
_param = self._free_text_summariser_relation_extraction_import_schema_serialize(
|
1838
|
+
file=file,
|
1839
|
+
q_answer_api_key=q_answer_api_key,
|
1840
|
+
_request_auth=_request_auth,
|
1841
|
+
_content_type=_content_type,
|
1842
|
+
_headers=_headers,
|
1843
|
+
_host_index=_host_index
|
1844
|
+
)
|
1845
|
+
|
1846
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1847
|
+
'200': "RelationExtractionConfiguration",
|
1848
|
+
}
|
1849
|
+
response_data = self.api_client.call_api(
|
1850
|
+
*_param,
|
1851
|
+
_request_timeout=_request_timeout
|
1852
|
+
)
|
1853
|
+
response_data.read()
|
1854
|
+
return self.api_client.response_deserialize(
|
1855
|
+
response_data=response_data,
|
1856
|
+
response_types_map=_response_types_map,
|
1857
|
+
).data
|
1858
|
+
|
1859
|
+
|
1860
|
+
@validate_call
|
1861
|
+
def free_text_summariser_relation_extraction_import_schema_with_http_info(
|
1862
|
+
self,
|
1863
|
+
file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
|
1864
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1865
|
+
_request_timeout: Union[
|
1866
|
+
None,
|
1867
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1868
|
+
Tuple[
|
1869
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1870
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1871
|
+
]
|
1872
|
+
] = None,
|
1873
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1874
|
+
_content_type: Optional[StrictStr] = None,
|
1875
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1876
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1877
|
+
) -> ApiResponse[RelationExtractionConfiguration]:
|
1878
|
+
"""Exports the schema for relation extraction
|
1879
|
+
|
1880
|
+
|
1881
|
+
:param file: (required)
|
1882
|
+
:type file: bytearray
|
1883
|
+
:param q_answer_api_key:
|
1884
|
+
:type q_answer_api_key: str
|
1885
|
+
:param _request_timeout: timeout setting for this request. If one
|
1886
|
+
number provided, it will be total request
|
1887
|
+
timeout. It can also be a pair (tuple) of
|
1888
|
+
(connection, read) timeouts.
|
1889
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1890
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1891
|
+
request; this effectively ignores the
|
1892
|
+
authentication in the spec for a single request.
|
1893
|
+
:type _request_auth: dict, optional
|
1894
|
+
:param _content_type: force content-type for the request.
|
1895
|
+
:type _content_type: str, Optional
|
1896
|
+
:param _headers: set to override the headers for a single
|
1897
|
+
request; this effectively ignores the headers
|
1898
|
+
in the spec for a single request.
|
1899
|
+
:type _headers: dict, optional
|
1900
|
+
:param _host_index: set to override the host_index for a single
|
1901
|
+
request; this effectively ignores the host_index
|
1902
|
+
in the spec for a single request.
|
1903
|
+
:type _host_index: int, optional
|
1904
|
+
:return: Returns the result object.
|
1905
|
+
""" # noqa: E501
|
1906
|
+
|
1907
|
+
_param = self._free_text_summariser_relation_extraction_import_schema_serialize(
|
1908
|
+
file=file,
|
1909
|
+
q_answer_api_key=q_answer_api_key,
|
1910
|
+
_request_auth=_request_auth,
|
1911
|
+
_content_type=_content_type,
|
1912
|
+
_headers=_headers,
|
1913
|
+
_host_index=_host_index
|
1914
|
+
)
|
1915
|
+
|
1916
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1917
|
+
'200': "RelationExtractionConfiguration",
|
1918
|
+
}
|
1919
|
+
response_data = self.api_client.call_api(
|
1920
|
+
*_param,
|
1921
|
+
_request_timeout=_request_timeout
|
1922
|
+
)
|
1923
|
+
response_data.read()
|
1924
|
+
return self.api_client.response_deserialize(
|
1925
|
+
response_data=response_data,
|
1926
|
+
response_types_map=_response_types_map,
|
1927
|
+
)
|
1928
|
+
|
1929
|
+
|
1930
|
+
@validate_call
|
1931
|
+
def free_text_summariser_relation_extraction_import_schema_without_preload_content(
|
1932
|
+
self,
|
1933
|
+
file: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]],
|
1934
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1935
|
+
_request_timeout: Union[
|
1936
|
+
None,
|
1937
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1938
|
+
Tuple[
|
1939
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1940
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1941
|
+
]
|
1942
|
+
] = None,
|
1943
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1944
|
+
_content_type: Optional[StrictStr] = None,
|
1945
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1946
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1947
|
+
) -> RESTResponseType:
|
1948
|
+
"""Exports the schema for relation extraction
|
1949
|
+
|
1950
|
+
|
1951
|
+
:param file: (required)
|
1952
|
+
:type file: bytearray
|
1953
|
+
:param q_answer_api_key:
|
1954
|
+
:type q_answer_api_key: str
|
1955
|
+
:param _request_timeout: timeout setting for this request. If one
|
1956
|
+
number provided, it will be total request
|
1957
|
+
timeout. It can also be a pair (tuple) of
|
1958
|
+
(connection, read) timeouts.
|
1959
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1960
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1961
|
+
request; this effectively ignores the
|
1962
|
+
authentication in the spec for a single request.
|
1963
|
+
:type _request_auth: dict, optional
|
1964
|
+
:param _content_type: force content-type for the request.
|
1965
|
+
:type _content_type: str, Optional
|
1966
|
+
:param _headers: set to override the headers for a single
|
1967
|
+
request; this effectively ignores the headers
|
1968
|
+
in the spec for a single request.
|
1969
|
+
:type _headers: dict, optional
|
1970
|
+
:param _host_index: set to override the host_index for a single
|
1971
|
+
request; this effectively ignores the host_index
|
1972
|
+
in the spec for a single request.
|
1973
|
+
:type _host_index: int, optional
|
1974
|
+
:return: Returns the result object.
|
1975
|
+
""" # noqa: E501
|
1976
|
+
|
1977
|
+
_param = self._free_text_summariser_relation_extraction_import_schema_serialize(
|
1978
|
+
file=file,
|
1979
|
+
q_answer_api_key=q_answer_api_key,
|
1980
|
+
_request_auth=_request_auth,
|
1981
|
+
_content_type=_content_type,
|
1982
|
+
_headers=_headers,
|
1983
|
+
_host_index=_host_index
|
1984
|
+
)
|
1985
|
+
|
1986
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1987
|
+
'200': "RelationExtractionConfiguration",
|
1988
|
+
}
|
1989
|
+
response_data = self.api_client.call_api(
|
1990
|
+
*_param,
|
1991
|
+
_request_timeout=_request_timeout
|
1992
|
+
)
|
1993
|
+
return response_data.response
|
1994
|
+
|
1995
|
+
|
1996
|
+
def _free_text_summariser_relation_extraction_import_schema_serialize(
|
1997
|
+
self,
|
1998
|
+
file,
|
1999
|
+
q_answer_api_key,
|
2000
|
+
_request_auth,
|
2001
|
+
_content_type,
|
2002
|
+
_headers,
|
2003
|
+
_host_index,
|
2004
|
+
) -> RequestSerialized:
|
2005
|
+
|
2006
|
+
_host = None
|
2007
|
+
|
2008
|
+
_collection_formats: Dict[str, str] = {
|
2009
|
+
}
|
2010
|
+
|
2011
|
+
_path_params: Dict[str, str] = {}
|
2012
|
+
_query_params: List[Tuple[str, str]] = []
|
2013
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
2014
|
+
_form_params: List[Tuple[str, str]] = []
|
2015
|
+
_files: Dict[
|
2016
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
2017
|
+
] = {}
|
2018
|
+
_body_params: Optional[bytes] = None
|
2019
|
+
|
2020
|
+
# process the path parameters
|
2021
|
+
# process the query parameters
|
2022
|
+
# process the header parameters
|
2023
|
+
if q_answer_api_key is not None:
|
2024
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
2025
|
+
# process the form parameters
|
2026
|
+
if file is not None:
|
2027
|
+
_files['file'] = file
|
2028
|
+
# process the body parameter
|
2029
|
+
|
2030
|
+
|
2031
|
+
# set the HTTP header `Accept`
|
2032
|
+
if 'Accept' not in _header_params:
|
2033
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
2034
|
+
[
|
2035
|
+
'*/*'
|
2036
|
+
]
|
2037
|
+
)
|
2038
|
+
|
2039
|
+
# set the HTTP header `Content-Type`
|
2040
|
+
if _content_type:
|
2041
|
+
_header_params['Content-Type'] = _content_type
|
2042
|
+
else:
|
2043
|
+
_default_content_type = (
|
2044
|
+
self.api_client.select_header_content_type(
|
2045
|
+
[
|
2046
|
+
'multipart/form-data'
|
2047
|
+
]
|
2048
|
+
)
|
2049
|
+
)
|
2050
|
+
if _default_content_type is not None:
|
2051
|
+
_header_params['Content-Type'] = _default_content_type
|
2052
|
+
|
2053
|
+
# authentication setting
|
2054
|
+
_auth_settings: List[str] = [
|
2055
|
+
'QAnswer-Api-Key',
|
2056
|
+
'Bearer'
|
2057
|
+
]
|
2058
|
+
|
2059
|
+
return self.api_client.param_serialize(
|
2060
|
+
method='POST',
|
2061
|
+
resource_path='/api/tasks/relation-extraction/import-schema',
|
2062
|
+
path_params=_path_params,
|
2063
|
+
query_params=_query_params,
|
2064
|
+
header_params=_header_params,
|
2065
|
+
body=_body_params,
|
2066
|
+
post_params=_form_params,
|
2067
|
+
files=_files,
|
2068
|
+
auth_settings=_auth_settings,
|
2069
|
+
collection_formats=_collection_formats,
|
2070
|
+
_host=_host,
|
2071
|
+
_request_auth=_request_auth
|
2072
|
+
)
|
2073
|
+
|
2074
|
+
|
2075
|
+
|
2076
|
+
|
2077
|
+
@validate_call
|
2078
|
+
def get_relation_extraction_template(
|
2079
|
+
self,
|
2080
|
+
username: StrictStr,
|
2081
|
+
dataset: StrictStr,
|
2082
|
+
template_id: StrictInt,
|
2083
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2084
|
+
_request_timeout: Union[
|
2085
|
+
None,
|
2086
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2087
|
+
Tuple[
|
2088
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2089
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2090
|
+
]
|
2091
|
+
] = None,
|
2092
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2093
|
+
_content_type: Optional[StrictStr] = None,
|
2094
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2095
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2096
|
+
) -> RelationExtractionSchema:
|
2097
|
+
"""Get a specific relation extraction template
|
2098
|
+
|
2099
|
+
|
2100
|
+
:param username: (required)
|
2101
|
+
:type username: str
|
2102
|
+
:param dataset: (required)
|
2103
|
+
:type dataset: str
|
2104
|
+
:param template_id: (required)
|
2105
|
+
:type template_id: int
|
2106
|
+
:param q_answer_api_key:
|
2107
|
+
:type q_answer_api_key: str
|
2108
|
+
:param _request_timeout: timeout setting for this request. If one
|
2109
|
+
number provided, it will be total request
|
2110
|
+
timeout. It can also be a pair (tuple) of
|
2111
|
+
(connection, read) timeouts.
|
2112
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2113
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2114
|
+
request; this effectively ignores the
|
2115
|
+
authentication in the spec for a single request.
|
2116
|
+
:type _request_auth: dict, optional
|
2117
|
+
:param _content_type: force content-type for the request.
|
2118
|
+
:type _content_type: str, Optional
|
2119
|
+
:param _headers: set to override the headers for a single
|
2120
|
+
request; this effectively ignores the headers
|
2121
|
+
in the spec for a single request.
|
2122
|
+
:type _headers: dict, optional
|
2123
|
+
:param _host_index: set to override the host_index for a single
|
2124
|
+
request; this effectively ignores the host_index
|
2125
|
+
in the spec for a single request.
|
2126
|
+
:type _host_index: int, optional
|
2127
|
+
:return: Returns the result object.
|
2128
|
+
""" # noqa: E501
|
2129
|
+
|
2130
|
+
_param = self._get_relation_extraction_template_serialize(
|
2131
|
+
username=username,
|
2132
|
+
dataset=dataset,
|
2133
|
+
template_id=template_id,
|
2134
|
+
q_answer_api_key=q_answer_api_key,
|
2135
|
+
_request_auth=_request_auth,
|
2136
|
+
_content_type=_content_type,
|
2137
|
+
_headers=_headers,
|
2138
|
+
_host_index=_host_index
|
2139
|
+
)
|
2140
|
+
|
2141
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2142
|
+
'200': "RelationExtractionSchema",
|
2143
|
+
}
|
2144
|
+
response_data = self.api_client.call_api(
|
2145
|
+
*_param,
|
2146
|
+
_request_timeout=_request_timeout
|
2147
|
+
)
|
2148
|
+
response_data.read()
|
2149
|
+
return self.api_client.response_deserialize(
|
2150
|
+
response_data=response_data,
|
2151
|
+
response_types_map=_response_types_map,
|
2152
|
+
).data
|
2153
|
+
|
2154
|
+
|
2155
|
+
@validate_call
|
2156
|
+
def get_relation_extraction_template_with_http_info(
|
2157
|
+
self,
|
2158
|
+
username: StrictStr,
|
2159
|
+
dataset: StrictStr,
|
2160
|
+
template_id: StrictInt,
|
2161
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2162
|
+
_request_timeout: Union[
|
2163
|
+
None,
|
2164
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2165
|
+
Tuple[
|
2166
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2167
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2168
|
+
]
|
2169
|
+
] = None,
|
2170
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2171
|
+
_content_type: Optional[StrictStr] = None,
|
2172
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2173
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2174
|
+
) -> ApiResponse[RelationExtractionSchema]:
|
2175
|
+
"""Get a specific relation extraction template
|
2176
|
+
|
2177
|
+
|
2178
|
+
:param username: (required)
|
2179
|
+
:type username: str
|
2180
|
+
:param dataset: (required)
|
2181
|
+
:type dataset: str
|
2182
|
+
:param template_id: (required)
|
2183
|
+
:type template_id: int
|
2184
|
+
:param q_answer_api_key:
|
2185
|
+
:type q_answer_api_key: str
|
2186
|
+
:param _request_timeout: timeout setting for this request. If one
|
2187
|
+
number provided, it will be total request
|
2188
|
+
timeout. It can also be a pair (tuple) of
|
2189
|
+
(connection, read) timeouts.
|
2190
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2191
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2192
|
+
request; this effectively ignores the
|
2193
|
+
authentication in the spec for a single request.
|
2194
|
+
:type _request_auth: dict, optional
|
2195
|
+
:param _content_type: force content-type for the request.
|
2196
|
+
:type _content_type: str, Optional
|
2197
|
+
:param _headers: set to override the headers for a single
|
2198
|
+
request; this effectively ignores the headers
|
2199
|
+
in the spec for a single request.
|
2200
|
+
:type _headers: dict, optional
|
2201
|
+
:param _host_index: set to override the host_index for a single
|
2202
|
+
request; this effectively ignores the host_index
|
2203
|
+
in the spec for a single request.
|
2204
|
+
:type _host_index: int, optional
|
2205
|
+
:return: Returns the result object.
|
2206
|
+
""" # noqa: E501
|
2207
|
+
|
2208
|
+
_param = self._get_relation_extraction_template_serialize(
|
2209
|
+
username=username,
|
2210
|
+
dataset=dataset,
|
2211
|
+
template_id=template_id,
|
2212
|
+
q_answer_api_key=q_answer_api_key,
|
2213
|
+
_request_auth=_request_auth,
|
2214
|
+
_content_type=_content_type,
|
2215
|
+
_headers=_headers,
|
2216
|
+
_host_index=_host_index
|
2217
|
+
)
|
2218
|
+
|
2219
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2220
|
+
'200': "RelationExtractionSchema",
|
2221
|
+
}
|
2222
|
+
response_data = self.api_client.call_api(
|
2223
|
+
*_param,
|
2224
|
+
_request_timeout=_request_timeout
|
2225
|
+
)
|
2226
|
+
response_data.read()
|
2227
|
+
return self.api_client.response_deserialize(
|
2228
|
+
response_data=response_data,
|
2229
|
+
response_types_map=_response_types_map,
|
2230
|
+
)
|
2231
|
+
|
2232
|
+
|
2233
|
+
@validate_call
|
2234
|
+
def get_relation_extraction_template_without_preload_content(
|
2235
|
+
self,
|
2236
|
+
username: StrictStr,
|
2237
|
+
dataset: StrictStr,
|
2238
|
+
template_id: StrictInt,
|
2239
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2240
|
+
_request_timeout: Union[
|
2241
|
+
None,
|
2242
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2243
|
+
Tuple[
|
2244
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2245
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2246
|
+
]
|
2247
|
+
] = None,
|
2248
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2249
|
+
_content_type: Optional[StrictStr] = None,
|
2250
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2251
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2252
|
+
) -> RESTResponseType:
|
2253
|
+
"""Get a specific relation extraction template
|
2254
|
+
|
2255
|
+
|
2256
|
+
:param username: (required)
|
2257
|
+
:type username: str
|
2258
|
+
:param dataset: (required)
|
2259
|
+
:type dataset: str
|
2260
|
+
:param template_id: (required)
|
2261
|
+
:type template_id: int
|
2262
|
+
:param q_answer_api_key:
|
2263
|
+
:type q_answer_api_key: str
|
2264
|
+
:param _request_timeout: timeout setting for this request. If one
|
2265
|
+
number provided, it will be total request
|
2266
|
+
timeout. It can also be a pair (tuple) of
|
2267
|
+
(connection, read) timeouts.
|
2268
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2269
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2270
|
+
request; this effectively ignores the
|
2271
|
+
authentication in the spec for a single request.
|
2272
|
+
:type _request_auth: dict, optional
|
2273
|
+
:param _content_type: force content-type for the request.
|
2274
|
+
:type _content_type: str, Optional
|
2275
|
+
:param _headers: set to override the headers for a single
|
2276
|
+
request; this effectively ignores the headers
|
2277
|
+
in the spec for a single request.
|
2278
|
+
:type _headers: dict, optional
|
2279
|
+
:param _host_index: set to override the host_index for a single
|
2280
|
+
request; this effectively ignores the host_index
|
2281
|
+
in the spec for a single request.
|
2282
|
+
:type _host_index: int, optional
|
2283
|
+
:return: Returns the result object.
|
2284
|
+
""" # noqa: E501
|
2285
|
+
|
2286
|
+
_param = self._get_relation_extraction_template_serialize(
|
2287
|
+
username=username,
|
2288
|
+
dataset=dataset,
|
2289
|
+
template_id=template_id,
|
2290
|
+
q_answer_api_key=q_answer_api_key,
|
2291
|
+
_request_auth=_request_auth,
|
2292
|
+
_content_type=_content_type,
|
2293
|
+
_headers=_headers,
|
2294
|
+
_host_index=_host_index
|
2295
|
+
)
|
2296
|
+
|
2297
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2298
|
+
'200': "RelationExtractionSchema",
|
2299
|
+
}
|
2300
|
+
response_data = self.api_client.call_api(
|
2301
|
+
*_param,
|
2302
|
+
_request_timeout=_request_timeout
|
2303
|
+
)
|
2304
|
+
return response_data.response
|
2305
|
+
|
2306
|
+
|
2307
|
+
def _get_relation_extraction_template_serialize(
|
2308
|
+
self,
|
2309
|
+
username,
|
2310
|
+
dataset,
|
2311
|
+
template_id,
|
2312
|
+
q_answer_api_key,
|
2313
|
+
_request_auth,
|
2314
|
+
_content_type,
|
2315
|
+
_headers,
|
2316
|
+
_host_index,
|
2317
|
+
) -> RequestSerialized:
|
2318
|
+
|
2319
|
+
_host = None
|
2320
|
+
|
2321
|
+
_collection_formats: Dict[str, str] = {
|
2322
|
+
}
|
2323
|
+
|
2324
|
+
_path_params: Dict[str, str] = {}
|
2325
|
+
_query_params: List[Tuple[str, str]] = []
|
2326
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
2327
|
+
_form_params: List[Tuple[str, str]] = []
|
2328
|
+
_files: Dict[
|
2329
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
2330
|
+
] = {}
|
2331
|
+
_body_params: Optional[bytes] = None
|
2332
|
+
|
2333
|
+
# process the path parameters
|
2334
|
+
if template_id is not None:
|
2335
|
+
_path_params['templateId'] = template_id
|
2336
|
+
# process the query parameters
|
2337
|
+
if username is not None:
|
2338
|
+
|
2339
|
+
_query_params.append(('username', username))
|
2340
|
+
|
2341
|
+
if dataset is not None:
|
2342
|
+
|
2343
|
+
_query_params.append(('dataset', dataset))
|
2344
|
+
|
2345
|
+
# process the header parameters
|
2346
|
+
if q_answer_api_key is not None:
|
2347
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
2348
|
+
# process the form parameters
|
2349
|
+
# process the body parameter
|
2350
|
+
|
2351
|
+
|
2352
|
+
# set the HTTP header `Accept`
|
2353
|
+
if 'Accept' not in _header_params:
|
2354
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
2355
|
+
[
|
2356
|
+
'*/*'
|
2357
|
+
]
|
2358
|
+
)
|
2359
|
+
|
2360
|
+
|
2361
|
+
# authentication setting
|
2362
|
+
_auth_settings: List[str] = [
|
2363
|
+
'QAnswer-Api-Key',
|
2364
|
+
'Bearer'
|
2365
|
+
]
|
2366
|
+
|
2367
|
+
return self.api_client.param_serialize(
|
2368
|
+
method='GET',
|
2369
|
+
resource_path='/api/tasks/relation-extraction/templates/{templateId}',
|
2370
|
+
path_params=_path_params,
|
2371
|
+
query_params=_query_params,
|
2372
|
+
header_params=_header_params,
|
2373
|
+
body=_body_params,
|
2374
|
+
post_params=_form_params,
|
2375
|
+
files=_files,
|
2376
|
+
auth_settings=_auth_settings,
|
2377
|
+
collection_formats=_collection_formats,
|
2378
|
+
_host=_host,
|
2379
|
+
_request_auth=_request_auth
|
2380
|
+
)
|
2381
|
+
|
2382
|
+
|
2383
|
+
|
2384
|
+
|
2385
|
+
@validate_call
|
2386
|
+
def list_relation_extraction_templates(
|
2387
|
+
self,
|
2388
|
+
username: StrictStr,
|
2389
|
+
dataset: StrictStr,
|
2390
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2391
|
+
_request_timeout: Union[
|
2392
|
+
None,
|
2393
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2394
|
+
Tuple[
|
2395
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2396
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2397
|
+
]
|
2398
|
+
] = None,
|
2399
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2400
|
+
_content_type: Optional[StrictStr] = None,
|
2401
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2402
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2403
|
+
) -> List[RelationExtractionSchema]:
|
2404
|
+
"""List all relation extraction templates
|
2405
|
+
|
2406
|
+
|
2407
|
+
:param username: (required)
|
2408
|
+
:type username: str
|
2409
|
+
:param dataset: (required)
|
2410
|
+
:type dataset: str
|
2411
|
+
:param q_answer_api_key:
|
2412
|
+
:type q_answer_api_key: str
|
2413
|
+
:param _request_timeout: timeout setting for this request. If one
|
2414
|
+
number provided, it will be total request
|
2415
|
+
timeout. It can also be a pair (tuple) of
|
2416
|
+
(connection, read) timeouts.
|
2417
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2418
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2419
|
+
request; this effectively ignores the
|
2420
|
+
authentication in the spec for a single request.
|
2421
|
+
:type _request_auth: dict, optional
|
2422
|
+
:param _content_type: force content-type for the request.
|
2423
|
+
:type _content_type: str, Optional
|
2424
|
+
:param _headers: set to override the headers for a single
|
2425
|
+
request; this effectively ignores the headers
|
2426
|
+
in the spec for a single request.
|
2427
|
+
:type _headers: dict, optional
|
2428
|
+
:param _host_index: set to override the host_index for a single
|
2429
|
+
request; this effectively ignores the host_index
|
2430
|
+
in the spec for a single request.
|
2431
|
+
:type _host_index: int, optional
|
2432
|
+
:return: Returns the result object.
|
2433
|
+
""" # noqa: E501
|
2434
|
+
|
2435
|
+
_param = self._list_relation_extraction_templates_serialize(
|
2436
|
+
username=username,
|
2437
|
+
dataset=dataset,
|
2438
|
+
q_answer_api_key=q_answer_api_key,
|
2439
|
+
_request_auth=_request_auth,
|
2440
|
+
_content_type=_content_type,
|
2441
|
+
_headers=_headers,
|
2442
|
+
_host_index=_host_index
|
2443
|
+
)
|
2444
|
+
|
2445
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2446
|
+
'200': "List[RelationExtractionSchema]",
|
2447
|
+
}
|
2448
|
+
response_data = self.api_client.call_api(
|
2449
|
+
*_param,
|
2450
|
+
_request_timeout=_request_timeout
|
2451
|
+
)
|
2452
|
+
response_data.read()
|
2453
|
+
return self.api_client.response_deserialize(
|
2454
|
+
response_data=response_data,
|
2455
|
+
response_types_map=_response_types_map,
|
2456
|
+
).data
|
2457
|
+
|
2458
|
+
|
2459
|
+
@validate_call
|
2460
|
+
def list_relation_extraction_templates_with_http_info(
|
2461
|
+
self,
|
2462
|
+
username: StrictStr,
|
2463
|
+
dataset: StrictStr,
|
2464
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2465
|
+
_request_timeout: Union[
|
2466
|
+
None,
|
2467
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2468
|
+
Tuple[
|
2469
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2470
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2471
|
+
]
|
2472
|
+
] = None,
|
2473
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2474
|
+
_content_type: Optional[StrictStr] = None,
|
2475
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2476
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2477
|
+
) -> ApiResponse[List[RelationExtractionSchema]]:
|
2478
|
+
"""List all relation extraction templates
|
2479
|
+
|
2480
|
+
|
2481
|
+
:param username: (required)
|
2482
|
+
:type username: str
|
2483
|
+
:param dataset: (required)
|
2484
|
+
:type dataset: str
|
2485
|
+
:param q_answer_api_key:
|
2486
|
+
:type q_answer_api_key: str
|
2487
|
+
:param _request_timeout: timeout setting for this request. If one
|
2488
|
+
number provided, it will be total request
|
2489
|
+
timeout. It can also be a pair (tuple) of
|
2490
|
+
(connection, read) timeouts.
|
2491
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2492
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2493
|
+
request; this effectively ignores the
|
2494
|
+
authentication in the spec for a single request.
|
2495
|
+
:type _request_auth: dict, optional
|
2496
|
+
:param _content_type: force content-type for the request.
|
2497
|
+
:type _content_type: str, Optional
|
2498
|
+
:param _headers: set to override the headers for a single
|
2499
|
+
request; this effectively ignores the headers
|
2500
|
+
in the spec for a single request.
|
2501
|
+
:type _headers: dict, optional
|
2502
|
+
:param _host_index: set to override the host_index for a single
|
2503
|
+
request; this effectively ignores the host_index
|
2504
|
+
in the spec for a single request.
|
2505
|
+
:type _host_index: int, optional
|
2506
|
+
:return: Returns the result object.
|
2507
|
+
""" # noqa: E501
|
2508
|
+
|
2509
|
+
_param = self._list_relation_extraction_templates_serialize(
|
2510
|
+
username=username,
|
2511
|
+
dataset=dataset,
|
2512
|
+
q_answer_api_key=q_answer_api_key,
|
2513
|
+
_request_auth=_request_auth,
|
2514
|
+
_content_type=_content_type,
|
2515
|
+
_headers=_headers,
|
2516
|
+
_host_index=_host_index
|
2517
|
+
)
|
2518
|
+
|
2519
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2520
|
+
'200': "List[RelationExtractionSchema]",
|
2521
|
+
}
|
2522
|
+
response_data = self.api_client.call_api(
|
2523
|
+
*_param,
|
2524
|
+
_request_timeout=_request_timeout
|
2525
|
+
)
|
2526
|
+
response_data.read()
|
2527
|
+
return self.api_client.response_deserialize(
|
2528
|
+
response_data=response_data,
|
2529
|
+
response_types_map=_response_types_map,
|
2530
|
+
)
|
2531
|
+
|
2532
|
+
|
2533
|
+
@validate_call
|
2534
|
+
def list_relation_extraction_templates_without_preload_content(
|
2535
|
+
self,
|
2536
|
+
username: StrictStr,
|
2537
|
+
dataset: StrictStr,
|
2538
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2539
|
+
_request_timeout: Union[
|
2540
|
+
None,
|
2541
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2542
|
+
Tuple[
|
2543
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2544
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2545
|
+
]
|
2546
|
+
] = None,
|
2547
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2548
|
+
_content_type: Optional[StrictStr] = None,
|
2549
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2550
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2551
|
+
) -> RESTResponseType:
|
2552
|
+
"""List all relation extraction templates
|
2553
|
+
|
2554
|
+
|
2555
|
+
:param username: (required)
|
2556
|
+
:type username: str
|
2557
|
+
:param dataset: (required)
|
2558
|
+
:type dataset: str
|
2559
|
+
:param q_answer_api_key:
|
2560
|
+
:type q_answer_api_key: str
|
2561
|
+
:param _request_timeout: timeout setting for this request. If one
|
2562
|
+
number provided, it will be total request
|
2563
|
+
timeout. It can also be a pair (tuple) of
|
2564
|
+
(connection, read) timeouts.
|
2565
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2566
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2567
|
+
request; this effectively ignores the
|
2568
|
+
authentication in the spec for a single request.
|
2569
|
+
:type _request_auth: dict, optional
|
2570
|
+
:param _content_type: force content-type for the request.
|
2571
|
+
:type _content_type: str, Optional
|
2572
|
+
:param _headers: set to override the headers for a single
|
2573
|
+
request; this effectively ignores the headers
|
2574
|
+
in the spec for a single request.
|
2575
|
+
:type _headers: dict, optional
|
2576
|
+
:param _host_index: set to override the host_index for a single
|
2577
|
+
request; this effectively ignores the host_index
|
2578
|
+
in the spec for a single request.
|
2579
|
+
:type _host_index: int, optional
|
2580
|
+
:return: Returns the result object.
|
2581
|
+
""" # noqa: E501
|
2582
|
+
|
2583
|
+
_param = self._list_relation_extraction_templates_serialize(
|
2584
|
+
username=username,
|
2585
|
+
dataset=dataset,
|
2586
|
+
q_answer_api_key=q_answer_api_key,
|
2587
|
+
_request_auth=_request_auth,
|
2588
|
+
_content_type=_content_type,
|
2589
|
+
_headers=_headers,
|
2590
|
+
_host_index=_host_index
|
2591
|
+
)
|
2592
|
+
|
2593
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2594
|
+
'200': "List[RelationExtractionSchema]",
|
2595
|
+
}
|
2596
|
+
response_data = self.api_client.call_api(
|
2597
|
+
*_param,
|
2598
|
+
_request_timeout=_request_timeout
|
2599
|
+
)
|
2600
|
+
return response_data.response
|
2601
|
+
|
2602
|
+
|
2603
|
+
def _list_relation_extraction_templates_serialize(
|
2604
|
+
self,
|
2605
|
+
username,
|
2606
|
+
dataset,
|
2607
|
+
q_answer_api_key,
|
2608
|
+
_request_auth,
|
2609
|
+
_content_type,
|
2610
|
+
_headers,
|
2611
|
+
_host_index,
|
2612
|
+
) -> RequestSerialized:
|
2613
|
+
|
2614
|
+
_host = None
|
2615
|
+
|
2616
|
+
_collection_formats: Dict[str, str] = {
|
2617
|
+
}
|
2618
|
+
|
2619
|
+
_path_params: Dict[str, str] = {}
|
2620
|
+
_query_params: List[Tuple[str, str]] = []
|
2621
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
2622
|
+
_form_params: List[Tuple[str, str]] = []
|
2623
|
+
_files: Dict[
|
2624
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
2625
|
+
] = {}
|
2626
|
+
_body_params: Optional[bytes] = None
|
2627
|
+
|
2628
|
+
# process the path parameters
|
2629
|
+
# process the query parameters
|
2630
|
+
if username is not None:
|
2631
|
+
|
2632
|
+
_query_params.append(('username', username))
|
2633
|
+
|
2634
|
+
if dataset is not None:
|
2635
|
+
|
2636
|
+
_query_params.append(('dataset', dataset))
|
2637
|
+
|
2638
|
+
# process the header parameters
|
2639
|
+
if q_answer_api_key is not None:
|
2640
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
2641
|
+
# process the form parameters
|
2642
|
+
# process the body parameter
|
2643
|
+
|
2644
|
+
|
2645
|
+
# set the HTTP header `Accept`
|
2646
|
+
if 'Accept' not in _header_params:
|
2647
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
2648
|
+
[
|
2649
|
+
'*/*'
|
2650
|
+
]
|
2651
|
+
)
|
2652
|
+
|
2653
|
+
|
2654
|
+
# authentication setting
|
2655
|
+
_auth_settings: List[str] = [
|
2656
|
+
'QAnswer-Api-Key',
|
2657
|
+
'Bearer'
|
2658
|
+
]
|
2659
|
+
|
2660
|
+
return self.api_client.param_serialize(
|
2661
|
+
method='GET',
|
2662
|
+
resource_path='/api/tasks/relation-extraction/templates',
|
2663
|
+
path_params=_path_params,
|
2664
|
+
query_params=_query_params,
|
2665
|
+
header_params=_header_params,
|
2666
|
+
body=_body_params,
|
2667
|
+
post_params=_form_params,
|
2668
|
+
files=_files,
|
2669
|
+
auth_settings=_auth_settings,
|
2670
|
+
collection_formats=_collection_formats,
|
2671
|
+
_host=_host,
|
2672
|
+
_request_auth=_request_auth
|
2673
|
+
)
|
2674
|
+
|
2675
|
+
|
2676
|
+
|
2677
|
+
|
2678
|
+
@validate_call
|
2679
|
+
def update_relation_extraction_template(
|
2680
|
+
self,
|
2681
|
+
template_id: StrictInt,
|
2682
|
+
relation_extraction_template_update_payload: RelationExtractionTemplateUpdatePayload,
|
2683
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2684
|
+
_request_timeout: Union[
|
2685
|
+
None,
|
2686
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2687
|
+
Tuple[
|
2688
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2689
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2690
|
+
]
|
2691
|
+
] = None,
|
2692
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2693
|
+
_content_type: Optional[StrictStr] = None,
|
2694
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2695
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2696
|
+
) -> RelationExtractionSchema:
|
2697
|
+
"""Update a relation extraction template
|
2698
|
+
|
2699
|
+
|
2700
|
+
:param template_id: (required)
|
2701
|
+
:type template_id: int
|
2702
|
+
:param relation_extraction_template_update_payload: (required)
|
2703
|
+
:type relation_extraction_template_update_payload: RelationExtractionTemplateUpdatePayload
|
2704
|
+
:param q_answer_api_key:
|
2705
|
+
:type q_answer_api_key: str
|
2706
|
+
:param _request_timeout: timeout setting for this request. If one
|
2707
|
+
number provided, it will be total request
|
2708
|
+
timeout. It can also be a pair (tuple) of
|
2709
|
+
(connection, read) timeouts.
|
2710
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2711
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2712
|
+
request; this effectively ignores the
|
2713
|
+
authentication in the spec for a single request.
|
2714
|
+
:type _request_auth: dict, optional
|
2715
|
+
:param _content_type: force content-type for the request.
|
2716
|
+
:type _content_type: str, Optional
|
2717
|
+
:param _headers: set to override the headers for a single
|
2718
|
+
request; this effectively ignores the headers
|
2719
|
+
in the spec for a single request.
|
2720
|
+
:type _headers: dict, optional
|
2721
|
+
:param _host_index: set to override the host_index for a single
|
2722
|
+
request; this effectively ignores the host_index
|
2723
|
+
in the spec for a single request.
|
2724
|
+
:type _host_index: int, optional
|
2725
|
+
:return: Returns the result object.
|
2726
|
+
""" # noqa: E501
|
2727
|
+
|
2728
|
+
_param = self._update_relation_extraction_template_serialize(
|
2729
|
+
template_id=template_id,
|
2730
|
+
relation_extraction_template_update_payload=relation_extraction_template_update_payload,
|
2731
|
+
q_answer_api_key=q_answer_api_key,
|
2732
|
+
_request_auth=_request_auth,
|
2733
|
+
_content_type=_content_type,
|
2734
|
+
_headers=_headers,
|
2735
|
+
_host_index=_host_index
|
2736
|
+
)
|
2737
|
+
|
2738
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2739
|
+
'200': "RelationExtractionSchema",
|
2740
|
+
}
|
2741
|
+
response_data = self.api_client.call_api(
|
2742
|
+
*_param,
|
2743
|
+
_request_timeout=_request_timeout
|
2744
|
+
)
|
2745
|
+
response_data.read()
|
2746
|
+
return self.api_client.response_deserialize(
|
2747
|
+
response_data=response_data,
|
2748
|
+
response_types_map=_response_types_map,
|
2749
|
+
).data
|
2750
|
+
|
2751
|
+
|
2752
|
+
@validate_call
|
2753
|
+
def update_relation_extraction_template_with_http_info(
|
2754
|
+
self,
|
2755
|
+
template_id: StrictInt,
|
2756
|
+
relation_extraction_template_update_payload: RelationExtractionTemplateUpdatePayload,
|
2757
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2758
|
+
_request_timeout: Union[
|
2759
|
+
None,
|
2760
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2761
|
+
Tuple[
|
2762
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2763
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2764
|
+
]
|
2765
|
+
] = None,
|
2766
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2767
|
+
_content_type: Optional[StrictStr] = None,
|
2768
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2769
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2770
|
+
) -> ApiResponse[RelationExtractionSchema]:
|
2771
|
+
"""Update a relation extraction template
|
2772
|
+
|
2773
|
+
|
2774
|
+
:param template_id: (required)
|
2775
|
+
:type template_id: int
|
2776
|
+
:param relation_extraction_template_update_payload: (required)
|
2777
|
+
:type relation_extraction_template_update_payload: RelationExtractionTemplateUpdatePayload
|
2778
|
+
:param q_answer_api_key:
|
2779
|
+
:type q_answer_api_key: str
|
2780
|
+
:param _request_timeout: timeout setting for this request. If one
|
2781
|
+
number provided, it will be total request
|
2782
|
+
timeout. It can also be a pair (tuple) of
|
2783
|
+
(connection, read) timeouts.
|
2784
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2785
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2786
|
+
request; this effectively ignores the
|
2787
|
+
authentication in the spec for a single request.
|
2788
|
+
:type _request_auth: dict, optional
|
2789
|
+
:param _content_type: force content-type for the request.
|
2790
|
+
:type _content_type: str, Optional
|
2791
|
+
:param _headers: set to override the headers for a single
|
2792
|
+
request; this effectively ignores the headers
|
2793
|
+
in the spec for a single request.
|
2794
|
+
:type _headers: dict, optional
|
2795
|
+
:param _host_index: set to override the host_index for a single
|
2796
|
+
request; this effectively ignores the host_index
|
2797
|
+
in the spec for a single request.
|
2798
|
+
:type _host_index: int, optional
|
2799
|
+
:return: Returns the result object.
|
2800
|
+
""" # noqa: E501
|
2801
|
+
|
2802
|
+
_param = self._update_relation_extraction_template_serialize(
|
2803
|
+
template_id=template_id,
|
2804
|
+
relation_extraction_template_update_payload=relation_extraction_template_update_payload,
|
2805
|
+
q_answer_api_key=q_answer_api_key,
|
2806
|
+
_request_auth=_request_auth,
|
2807
|
+
_content_type=_content_type,
|
2808
|
+
_headers=_headers,
|
2809
|
+
_host_index=_host_index
|
2810
|
+
)
|
2811
|
+
|
2812
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2813
|
+
'200': "RelationExtractionSchema",
|
2814
|
+
}
|
2815
|
+
response_data = self.api_client.call_api(
|
2816
|
+
*_param,
|
2817
|
+
_request_timeout=_request_timeout
|
2818
|
+
)
|
2819
|
+
response_data.read()
|
2820
|
+
return self.api_client.response_deserialize(
|
2821
|
+
response_data=response_data,
|
2822
|
+
response_types_map=_response_types_map,
|
2823
|
+
)
|
2824
|
+
|
2825
|
+
|
2826
|
+
@validate_call
|
2827
|
+
def update_relation_extraction_template_without_preload_content(
|
2828
|
+
self,
|
2829
|
+
template_id: StrictInt,
|
2830
|
+
relation_extraction_template_update_payload: RelationExtractionTemplateUpdatePayload,
|
2831
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
2832
|
+
_request_timeout: Union[
|
2833
|
+
None,
|
2834
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2835
|
+
Tuple[
|
2836
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2837
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2838
|
+
]
|
2839
|
+
] = None,
|
2840
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2841
|
+
_content_type: Optional[StrictStr] = None,
|
2842
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2843
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2844
|
+
) -> RESTResponseType:
|
2845
|
+
"""Update a relation extraction template
|
2846
|
+
|
2847
|
+
|
2848
|
+
:param template_id: (required)
|
2849
|
+
:type template_id: int
|
2850
|
+
:param relation_extraction_template_update_payload: (required)
|
2851
|
+
:type relation_extraction_template_update_payload: RelationExtractionTemplateUpdatePayload
|
2852
|
+
:param q_answer_api_key:
|
2853
|
+
:type q_answer_api_key: str
|
2854
|
+
:param _request_timeout: timeout setting for this request. If one
|
2855
|
+
number provided, it will be total request
|
2856
|
+
timeout. It can also be a pair (tuple) of
|
2857
|
+
(connection, read) timeouts.
|
2858
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2859
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2860
|
+
request; this effectively ignores the
|
2861
|
+
authentication in the spec for a single request.
|
2862
|
+
:type _request_auth: dict, optional
|
2863
|
+
:param _content_type: force content-type for the request.
|
2864
|
+
:type _content_type: str, Optional
|
2865
|
+
:param _headers: set to override the headers for a single
|
2866
|
+
request; this effectively ignores the headers
|
2867
|
+
in the spec for a single request.
|
2868
|
+
:type _headers: dict, optional
|
2869
|
+
:param _host_index: set to override the host_index for a single
|
2870
|
+
request; this effectively ignores the host_index
|
2871
|
+
in the spec for a single request.
|
2872
|
+
:type _host_index: int, optional
|
2873
|
+
:return: Returns the result object.
|
2874
|
+
""" # noqa: E501
|
2875
|
+
|
2876
|
+
_param = self._update_relation_extraction_template_serialize(
|
2877
|
+
template_id=template_id,
|
2878
|
+
relation_extraction_template_update_payload=relation_extraction_template_update_payload,
|
2879
|
+
q_answer_api_key=q_answer_api_key,
|
2880
|
+
_request_auth=_request_auth,
|
2881
|
+
_content_type=_content_type,
|
2882
|
+
_headers=_headers,
|
2883
|
+
_host_index=_host_index
|
2884
|
+
)
|
2885
|
+
|
2886
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2887
|
+
'200': "RelationExtractionSchema",
|
2888
|
+
}
|
2889
|
+
response_data = self.api_client.call_api(
|
2890
|
+
*_param,
|
2891
|
+
_request_timeout=_request_timeout
|
2892
|
+
)
|
2893
|
+
return response_data.response
|
2894
|
+
|
2895
|
+
|
2896
|
+
def _update_relation_extraction_template_serialize(
|
2897
|
+
self,
|
2898
|
+
template_id,
|
2899
|
+
relation_extraction_template_update_payload,
|
2900
|
+
q_answer_api_key,
|
2901
|
+
_request_auth,
|
2902
|
+
_content_type,
|
2903
|
+
_headers,
|
2904
|
+
_host_index,
|
2905
|
+
) -> RequestSerialized:
|
2906
|
+
|
2907
|
+
_host = None
|
2908
|
+
|
2909
|
+
_collection_formats: Dict[str, str] = {
|
2910
|
+
}
|
2911
|
+
|
2912
|
+
_path_params: Dict[str, str] = {}
|
2913
|
+
_query_params: List[Tuple[str, str]] = []
|
2914
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
2915
|
+
_form_params: List[Tuple[str, str]] = []
|
2916
|
+
_files: Dict[
|
2917
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
2918
|
+
] = {}
|
2919
|
+
_body_params: Optional[bytes] = None
|
2920
|
+
|
2921
|
+
# process the path parameters
|
2922
|
+
if template_id is not None:
|
2923
|
+
_path_params['templateId'] = template_id
|
2924
|
+
# process the query parameters
|
2925
|
+
# process the header parameters
|
2926
|
+
if q_answer_api_key is not None:
|
2927
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
2928
|
+
# process the form parameters
|
2929
|
+
# process the body parameter
|
2930
|
+
if relation_extraction_template_update_payload is not None:
|
2931
|
+
_body_params = relation_extraction_template_update_payload
|
2932
|
+
|
2933
|
+
|
2934
|
+
# set the HTTP header `Accept`
|
2935
|
+
if 'Accept' not in _header_params:
|
2936
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
2937
|
+
[
|
2938
|
+
'*/*'
|
2939
|
+
]
|
2940
|
+
)
|
2941
|
+
|
2942
|
+
# set the HTTP header `Content-Type`
|
2943
|
+
if _content_type:
|
2944
|
+
_header_params['Content-Type'] = _content_type
|
2945
|
+
else:
|
2946
|
+
_default_content_type = (
|
2947
|
+
self.api_client.select_header_content_type(
|
2948
|
+
[
|
2949
|
+
'application/json'
|
2950
|
+
]
|
2951
|
+
)
|
2952
|
+
)
|
2953
|
+
if _default_content_type is not None:
|
2954
|
+
_header_params['Content-Type'] = _default_content_type
|
2955
|
+
|
2956
|
+
# authentication setting
|
2957
|
+
_auth_settings: List[str] = [
|
2958
|
+
'QAnswer-Api-Key',
|
2959
|
+
'Bearer'
|
2960
|
+
]
|
2961
|
+
|
2962
|
+
return self.api_client.param_serialize(
|
2963
|
+
method='PUT',
|
2964
|
+
resource_path='/api/tasks/relation-extraction/templates/{templateId}',
|
2965
|
+
path_params=_path_params,
|
2966
|
+
query_params=_query_params,
|
2967
|
+
header_params=_header_params,
|
2968
|
+
body=_body_params,
|
2969
|
+
post_params=_form_params,
|
2970
|
+
files=_files,
|
2971
|
+
auth_settings=_auth_settings,
|
2972
|
+
collection_formats=_collection_formats,
|
2973
|
+
_host=_host,
|
2974
|
+
_request_auth=_request_auth
|
2975
|
+
)
|
2976
|
+
|
2977
|
+
|