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,914 @@
|
|
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 StrictStr
|
20
|
+
from typing import Optional
|
21
|
+
from qanswer_sdk.models.text_classification_payload import TextClassificationPayload
|
22
|
+
from qanswer_sdk.models.text_classification_response import TextClassificationResponse
|
23
|
+
from qanswer_sdk.models.text_classification_v2_payload import TextClassificationV2Payload
|
24
|
+
from qanswer_sdk.models.text_classification_v2_response import TextClassificationV2Response
|
25
|
+
|
26
|
+
from qanswer_sdk.api_client import ApiClient, RequestSerialized
|
27
|
+
from qanswer_sdk.api_response import ApiResponse
|
28
|
+
from qanswer_sdk.rest import RESTResponseType
|
29
|
+
|
30
|
+
|
31
|
+
class TaskTextClassificationApi:
|
32
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
33
|
+
Ref: https://openapi-generator.tech
|
34
|
+
|
35
|
+
Do not edit the class manually.
|
36
|
+
"""
|
37
|
+
|
38
|
+
def __init__(self, api_client=None) -> None:
|
39
|
+
if api_client is None:
|
40
|
+
api_client = ApiClient.get_default()
|
41
|
+
self.api_client = api_client
|
42
|
+
|
43
|
+
|
44
|
+
@validate_call
|
45
|
+
def advanced_classification(
|
46
|
+
self,
|
47
|
+
text_classification_payload: TextClassificationPayload,
|
48
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
49
|
+
_request_timeout: Union[
|
50
|
+
None,
|
51
|
+
Annotated[StrictFloat, Field(gt=0)],
|
52
|
+
Tuple[
|
53
|
+
Annotated[StrictFloat, Field(gt=0)],
|
54
|
+
Annotated[StrictFloat, Field(gt=0)]
|
55
|
+
]
|
56
|
+
] = None,
|
57
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
58
|
+
_content_type: Optional[StrictStr] = None,
|
59
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
60
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
61
|
+
) -> TextClassificationResponse:
|
62
|
+
"""(Deprecated) V1: single-class
|
63
|
+
|
64
|
+
Text classification with single-class support
|
65
|
+
|
66
|
+
:param text_classification_payload: (required)
|
67
|
+
:type text_classification_payload: TextClassificationPayload
|
68
|
+
:param q_answer_api_key:
|
69
|
+
:type q_answer_api_key: str
|
70
|
+
:param _request_timeout: timeout setting for this request. If one
|
71
|
+
number provided, it will be total request
|
72
|
+
timeout. It can also be a pair (tuple) of
|
73
|
+
(connection, read) timeouts.
|
74
|
+
:type _request_timeout: int, tuple(int, int), optional
|
75
|
+
:param _request_auth: set to override the auth_settings for an a single
|
76
|
+
request; this effectively ignores the
|
77
|
+
authentication in the spec for a single request.
|
78
|
+
:type _request_auth: dict, optional
|
79
|
+
:param _content_type: force content-type for the request.
|
80
|
+
:type _content_type: str, Optional
|
81
|
+
:param _headers: set to override the headers for a single
|
82
|
+
request; this effectively ignores the headers
|
83
|
+
in the spec for a single request.
|
84
|
+
:type _headers: dict, optional
|
85
|
+
:param _host_index: set to override the host_index for a single
|
86
|
+
request; this effectively ignores the host_index
|
87
|
+
in the spec for a single request.
|
88
|
+
:type _host_index: int, optional
|
89
|
+
:return: Returns the result object.
|
90
|
+
""" # noqa: E501
|
91
|
+
warnings.warn("POST /api/tasks/advanced-classification is deprecated.", DeprecationWarning)
|
92
|
+
|
93
|
+
_param = self._advanced_classification_serialize(
|
94
|
+
text_classification_payload=text_classification_payload,
|
95
|
+
q_answer_api_key=q_answer_api_key,
|
96
|
+
_request_auth=_request_auth,
|
97
|
+
_content_type=_content_type,
|
98
|
+
_headers=_headers,
|
99
|
+
_host_index=_host_index
|
100
|
+
)
|
101
|
+
|
102
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
103
|
+
'200': "TextClassificationResponse",
|
104
|
+
}
|
105
|
+
response_data = self.api_client.call_api(
|
106
|
+
*_param,
|
107
|
+
_request_timeout=_request_timeout
|
108
|
+
)
|
109
|
+
response_data.read()
|
110
|
+
return self.api_client.response_deserialize(
|
111
|
+
response_data=response_data,
|
112
|
+
response_types_map=_response_types_map,
|
113
|
+
).data
|
114
|
+
|
115
|
+
|
116
|
+
@validate_call
|
117
|
+
def advanced_classification_with_http_info(
|
118
|
+
self,
|
119
|
+
text_classification_payload: TextClassificationPayload,
|
120
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
121
|
+
_request_timeout: Union[
|
122
|
+
None,
|
123
|
+
Annotated[StrictFloat, Field(gt=0)],
|
124
|
+
Tuple[
|
125
|
+
Annotated[StrictFloat, Field(gt=0)],
|
126
|
+
Annotated[StrictFloat, Field(gt=0)]
|
127
|
+
]
|
128
|
+
] = None,
|
129
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
130
|
+
_content_type: Optional[StrictStr] = None,
|
131
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
132
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
133
|
+
) -> ApiResponse[TextClassificationResponse]:
|
134
|
+
"""(Deprecated) V1: single-class
|
135
|
+
|
136
|
+
Text classification with single-class support
|
137
|
+
|
138
|
+
:param text_classification_payload: (required)
|
139
|
+
:type text_classification_payload: TextClassificationPayload
|
140
|
+
:param q_answer_api_key:
|
141
|
+
:type q_answer_api_key: str
|
142
|
+
:param _request_timeout: timeout setting for this request. If one
|
143
|
+
number provided, it will be total request
|
144
|
+
timeout. It can also be a pair (tuple) of
|
145
|
+
(connection, read) timeouts.
|
146
|
+
:type _request_timeout: int, tuple(int, int), optional
|
147
|
+
:param _request_auth: set to override the auth_settings for an a single
|
148
|
+
request; this effectively ignores the
|
149
|
+
authentication in the spec for a single request.
|
150
|
+
:type _request_auth: dict, optional
|
151
|
+
:param _content_type: force content-type for the request.
|
152
|
+
:type _content_type: str, Optional
|
153
|
+
:param _headers: set to override the headers for a single
|
154
|
+
request; this effectively ignores the headers
|
155
|
+
in the spec for a single request.
|
156
|
+
:type _headers: dict, optional
|
157
|
+
:param _host_index: set to override the host_index for a single
|
158
|
+
request; this effectively ignores the host_index
|
159
|
+
in the spec for a single request.
|
160
|
+
:type _host_index: int, optional
|
161
|
+
:return: Returns the result object.
|
162
|
+
""" # noqa: E501
|
163
|
+
warnings.warn("POST /api/tasks/advanced-classification is deprecated.", DeprecationWarning)
|
164
|
+
|
165
|
+
_param = self._advanced_classification_serialize(
|
166
|
+
text_classification_payload=text_classification_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': "TextClassificationResponse",
|
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 advanced_classification_without_preload_content(
|
190
|
+
self,
|
191
|
+
text_classification_payload: TextClassificationPayload,
|
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
|
+
"""(Deprecated) V1: single-class
|
207
|
+
|
208
|
+
Text classification with single-class support
|
209
|
+
|
210
|
+
:param text_classification_payload: (required)
|
211
|
+
:type text_classification_payload: TextClassificationPayload
|
212
|
+
:param q_answer_api_key:
|
213
|
+
:type q_answer_api_key: str
|
214
|
+
:param _request_timeout: timeout setting for this request. If one
|
215
|
+
number provided, it will be total request
|
216
|
+
timeout. It can also be a pair (tuple) of
|
217
|
+
(connection, read) timeouts.
|
218
|
+
:type _request_timeout: int, tuple(int, int), optional
|
219
|
+
:param _request_auth: set to override the auth_settings for an a single
|
220
|
+
request; this effectively ignores the
|
221
|
+
authentication in the spec for a single request.
|
222
|
+
:type _request_auth: dict, optional
|
223
|
+
:param _content_type: force content-type for the request.
|
224
|
+
:type _content_type: str, Optional
|
225
|
+
:param _headers: set to override the headers for a single
|
226
|
+
request; this effectively ignores the headers
|
227
|
+
in the spec for a single request.
|
228
|
+
:type _headers: dict, optional
|
229
|
+
:param _host_index: set to override the host_index for a single
|
230
|
+
request; this effectively ignores the host_index
|
231
|
+
in the spec for a single request.
|
232
|
+
:type _host_index: int, optional
|
233
|
+
:return: Returns the result object.
|
234
|
+
""" # noqa: E501
|
235
|
+
warnings.warn("POST /api/tasks/advanced-classification is deprecated.", DeprecationWarning)
|
236
|
+
|
237
|
+
_param = self._advanced_classification_serialize(
|
238
|
+
text_classification_payload=text_classification_payload,
|
239
|
+
q_answer_api_key=q_answer_api_key,
|
240
|
+
_request_auth=_request_auth,
|
241
|
+
_content_type=_content_type,
|
242
|
+
_headers=_headers,
|
243
|
+
_host_index=_host_index
|
244
|
+
)
|
245
|
+
|
246
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
247
|
+
'200': "TextClassificationResponse",
|
248
|
+
}
|
249
|
+
response_data = self.api_client.call_api(
|
250
|
+
*_param,
|
251
|
+
_request_timeout=_request_timeout
|
252
|
+
)
|
253
|
+
return response_data.response
|
254
|
+
|
255
|
+
|
256
|
+
def _advanced_classification_serialize(
|
257
|
+
self,
|
258
|
+
text_classification_payload,
|
259
|
+
q_answer_api_key,
|
260
|
+
_request_auth,
|
261
|
+
_content_type,
|
262
|
+
_headers,
|
263
|
+
_host_index,
|
264
|
+
) -> RequestSerialized:
|
265
|
+
|
266
|
+
_host = None
|
267
|
+
|
268
|
+
_collection_formats: Dict[str, str] = {
|
269
|
+
}
|
270
|
+
|
271
|
+
_path_params: Dict[str, str] = {}
|
272
|
+
_query_params: List[Tuple[str, str]] = []
|
273
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
274
|
+
_form_params: List[Tuple[str, str]] = []
|
275
|
+
_files: Dict[
|
276
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
277
|
+
] = {}
|
278
|
+
_body_params: Optional[bytes] = None
|
279
|
+
|
280
|
+
# process the path parameters
|
281
|
+
# process the query parameters
|
282
|
+
# process the header parameters
|
283
|
+
if q_answer_api_key is not None:
|
284
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
285
|
+
# process the form parameters
|
286
|
+
# process the body parameter
|
287
|
+
if text_classification_payload is not None:
|
288
|
+
_body_params = text_classification_payload
|
289
|
+
|
290
|
+
|
291
|
+
# set the HTTP header `Accept`
|
292
|
+
if 'Accept' not in _header_params:
|
293
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
294
|
+
[
|
295
|
+
'*/*'
|
296
|
+
]
|
297
|
+
)
|
298
|
+
|
299
|
+
# set the HTTP header `Content-Type`
|
300
|
+
if _content_type:
|
301
|
+
_header_params['Content-Type'] = _content_type
|
302
|
+
else:
|
303
|
+
_default_content_type = (
|
304
|
+
self.api_client.select_header_content_type(
|
305
|
+
[
|
306
|
+
'application/json'
|
307
|
+
]
|
308
|
+
)
|
309
|
+
)
|
310
|
+
if _default_content_type is not None:
|
311
|
+
_header_params['Content-Type'] = _default_content_type
|
312
|
+
|
313
|
+
# authentication setting
|
314
|
+
_auth_settings: List[str] = [
|
315
|
+
'QAnswer-Api-Key',
|
316
|
+
'Bearer'
|
317
|
+
]
|
318
|
+
|
319
|
+
return self.api_client.param_serialize(
|
320
|
+
method='POST',
|
321
|
+
resource_path='/api/tasks/advanced-classification',
|
322
|
+
path_params=_path_params,
|
323
|
+
query_params=_query_params,
|
324
|
+
header_params=_header_params,
|
325
|
+
body=_body_params,
|
326
|
+
post_params=_form_params,
|
327
|
+
files=_files,
|
328
|
+
auth_settings=_auth_settings,
|
329
|
+
collection_formats=_collection_formats,
|
330
|
+
_host=_host,
|
331
|
+
_request_auth=_request_auth
|
332
|
+
)
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
@validate_call
|
338
|
+
def advanced_classification_v2(
|
339
|
+
self,
|
340
|
+
text_classification_v2_payload: TextClassificationV2Payload,
|
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
|
+
) -> TextClassificationV2Response:
|
355
|
+
"""V2: multi-class & probability
|
356
|
+
|
357
|
+
Text classification with multi-class support and probability
|
358
|
+
|
359
|
+
:param text_classification_v2_payload: (required)
|
360
|
+
:type text_classification_v2_payload: TextClassificationV2Payload
|
361
|
+
:param q_answer_api_key:
|
362
|
+
:type q_answer_api_key: str
|
363
|
+
:param _request_timeout: timeout setting for this request. If one
|
364
|
+
number provided, it will be total request
|
365
|
+
timeout. It can also be a pair (tuple) of
|
366
|
+
(connection, read) timeouts.
|
367
|
+
:type _request_timeout: int, tuple(int, int), optional
|
368
|
+
:param _request_auth: set to override the auth_settings for an a single
|
369
|
+
request; this effectively ignores the
|
370
|
+
authentication in the spec for a single request.
|
371
|
+
:type _request_auth: dict, optional
|
372
|
+
:param _content_type: force content-type for the request.
|
373
|
+
:type _content_type: str, Optional
|
374
|
+
:param _headers: set to override the headers for a single
|
375
|
+
request; this effectively ignores the headers
|
376
|
+
in the spec for a single request.
|
377
|
+
:type _headers: dict, optional
|
378
|
+
:param _host_index: set to override the host_index for a single
|
379
|
+
request; this effectively ignores the host_index
|
380
|
+
in the spec for a single request.
|
381
|
+
:type _host_index: int, optional
|
382
|
+
:return: Returns the result object.
|
383
|
+
""" # noqa: E501
|
384
|
+
|
385
|
+
_param = self._advanced_classification_v2_serialize(
|
386
|
+
text_classification_v2_payload=text_classification_v2_payload,
|
387
|
+
q_answer_api_key=q_answer_api_key,
|
388
|
+
_request_auth=_request_auth,
|
389
|
+
_content_type=_content_type,
|
390
|
+
_headers=_headers,
|
391
|
+
_host_index=_host_index
|
392
|
+
)
|
393
|
+
|
394
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
395
|
+
'200': "TextClassificationV2Response",
|
396
|
+
}
|
397
|
+
response_data = self.api_client.call_api(
|
398
|
+
*_param,
|
399
|
+
_request_timeout=_request_timeout
|
400
|
+
)
|
401
|
+
response_data.read()
|
402
|
+
return self.api_client.response_deserialize(
|
403
|
+
response_data=response_data,
|
404
|
+
response_types_map=_response_types_map,
|
405
|
+
).data
|
406
|
+
|
407
|
+
|
408
|
+
@validate_call
|
409
|
+
def advanced_classification_v2_with_http_info(
|
410
|
+
self,
|
411
|
+
text_classification_v2_payload: TextClassificationV2Payload,
|
412
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
413
|
+
_request_timeout: Union[
|
414
|
+
None,
|
415
|
+
Annotated[StrictFloat, Field(gt=0)],
|
416
|
+
Tuple[
|
417
|
+
Annotated[StrictFloat, Field(gt=0)],
|
418
|
+
Annotated[StrictFloat, Field(gt=0)]
|
419
|
+
]
|
420
|
+
] = None,
|
421
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
422
|
+
_content_type: Optional[StrictStr] = None,
|
423
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
424
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
425
|
+
) -> ApiResponse[TextClassificationV2Response]:
|
426
|
+
"""V2: multi-class & probability
|
427
|
+
|
428
|
+
Text classification with multi-class support and probability
|
429
|
+
|
430
|
+
:param text_classification_v2_payload: (required)
|
431
|
+
:type text_classification_v2_payload: TextClassificationV2Payload
|
432
|
+
:param q_answer_api_key:
|
433
|
+
:type q_answer_api_key: str
|
434
|
+
:param _request_timeout: timeout setting for this request. If one
|
435
|
+
number provided, it will be total request
|
436
|
+
timeout. It can also be a pair (tuple) of
|
437
|
+
(connection, read) timeouts.
|
438
|
+
:type _request_timeout: int, tuple(int, int), optional
|
439
|
+
:param _request_auth: set to override the auth_settings for an a single
|
440
|
+
request; this effectively ignores the
|
441
|
+
authentication in the spec for a single request.
|
442
|
+
:type _request_auth: dict, optional
|
443
|
+
:param _content_type: force content-type for the request.
|
444
|
+
:type _content_type: str, Optional
|
445
|
+
:param _headers: set to override the headers for a single
|
446
|
+
request; this effectively ignores the headers
|
447
|
+
in the spec for a single request.
|
448
|
+
:type _headers: dict, optional
|
449
|
+
:param _host_index: set to override the host_index for a single
|
450
|
+
request; this effectively ignores the host_index
|
451
|
+
in the spec for a single request.
|
452
|
+
:type _host_index: int, optional
|
453
|
+
:return: Returns the result object.
|
454
|
+
""" # noqa: E501
|
455
|
+
|
456
|
+
_param = self._advanced_classification_v2_serialize(
|
457
|
+
text_classification_v2_payload=text_classification_v2_payload,
|
458
|
+
q_answer_api_key=q_answer_api_key,
|
459
|
+
_request_auth=_request_auth,
|
460
|
+
_content_type=_content_type,
|
461
|
+
_headers=_headers,
|
462
|
+
_host_index=_host_index
|
463
|
+
)
|
464
|
+
|
465
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
466
|
+
'200': "TextClassificationV2Response",
|
467
|
+
}
|
468
|
+
response_data = self.api_client.call_api(
|
469
|
+
*_param,
|
470
|
+
_request_timeout=_request_timeout
|
471
|
+
)
|
472
|
+
response_data.read()
|
473
|
+
return self.api_client.response_deserialize(
|
474
|
+
response_data=response_data,
|
475
|
+
response_types_map=_response_types_map,
|
476
|
+
)
|
477
|
+
|
478
|
+
|
479
|
+
@validate_call
|
480
|
+
def advanced_classification_v2_without_preload_content(
|
481
|
+
self,
|
482
|
+
text_classification_v2_payload: TextClassificationV2Payload,
|
483
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
484
|
+
_request_timeout: Union[
|
485
|
+
None,
|
486
|
+
Annotated[StrictFloat, Field(gt=0)],
|
487
|
+
Tuple[
|
488
|
+
Annotated[StrictFloat, Field(gt=0)],
|
489
|
+
Annotated[StrictFloat, Field(gt=0)]
|
490
|
+
]
|
491
|
+
] = None,
|
492
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
493
|
+
_content_type: Optional[StrictStr] = None,
|
494
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
495
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
496
|
+
) -> RESTResponseType:
|
497
|
+
"""V2: multi-class & probability
|
498
|
+
|
499
|
+
Text classification with multi-class support and probability
|
500
|
+
|
501
|
+
:param text_classification_v2_payload: (required)
|
502
|
+
:type text_classification_v2_payload: TextClassificationV2Payload
|
503
|
+
:param q_answer_api_key:
|
504
|
+
:type q_answer_api_key: str
|
505
|
+
:param _request_timeout: timeout setting for this request. If one
|
506
|
+
number provided, it will be total request
|
507
|
+
timeout. It can also be a pair (tuple) of
|
508
|
+
(connection, read) timeouts.
|
509
|
+
:type _request_timeout: int, tuple(int, int), optional
|
510
|
+
:param _request_auth: set to override the auth_settings for an a single
|
511
|
+
request; this effectively ignores the
|
512
|
+
authentication in the spec for a single request.
|
513
|
+
:type _request_auth: dict, optional
|
514
|
+
:param _content_type: force content-type for the request.
|
515
|
+
:type _content_type: str, Optional
|
516
|
+
:param _headers: set to override the headers for a single
|
517
|
+
request; this effectively ignores the headers
|
518
|
+
in the spec for a single request.
|
519
|
+
:type _headers: dict, optional
|
520
|
+
:param _host_index: set to override the host_index for a single
|
521
|
+
request; this effectively ignores the host_index
|
522
|
+
in the spec for a single request.
|
523
|
+
:type _host_index: int, optional
|
524
|
+
:return: Returns the result object.
|
525
|
+
""" # noqa: E501
|
526
|
+
|
527
|
+
_param = self._advanced_classification_v2_serialize(
|
528
|
+
text_classification_v2_payload=text_classification_v2_payload,
|
529
|
+
q_answer_api_key=q_answer_api_key,
|
530
|
+
_request_auth=_request_auth,
|
531
|
+
_content_type=_content_type,
|
532
|
+
_headers=_headers,
|
533
|
+
_host_index=_host_index
|
534
|
+
)
|
535
|
+
|
536
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
537
|
+
'200': "TextClassificationV2Response",
|
538
|
+
}
|
539
|
+
response_data = self.api_client.call_api(
|
540
|
+
*_param,
|
541
|
+
_request_timeout=_request_timeout
|
542
|
+
)
|
543
|
+
return response_data.response
|
544
|
+
|
545
|
+
|
546
|
+
def _advanced_classification_v2_serialize(
|
547
|
+
self,
|
548
|
+
text_classification_v2_payload,
|
549
|
+
q_answer_api_key,
|
550
|
+
_request_auth,
|
551
|
+
_content_type,
|
552
|
+
_headers,
|
553
|
+
_host_index,
|
554
|
+
) -> RequestSerialized:
|
555
|
+
|
556
|
+
_host = None
|
557
|
+
|
558
|
+
_collection_formats: Dict[str, str] = {
|
559
|
+
}
|
560
|
+
|
561
|
+
_path_params: Dict[str, str] = {}
|
562
|
+
_query_params: List[Tuple[str, str]] = []
|
563
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
564
|
+
_form_params: List[Tuple[str, str]] = []
|
565
|
+
_files: Dict[
|
566
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
567
|
+
] = {}
|
568
|
+
_body_params: Optional[bytes] = None
|
569
|
+
|
570
|
+
# process the path parameters
|
571
|
+
# process the query parameters
|
572
|
+
# process the header parameters
|
573
|
+
if q_answer_api_key is not None:
|
574
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
575
|
+
# process the form parameters
|
576
|
+
# process the body parameter
|
577
|
+
if text_classification_v2_payload is not None:
|
578
|
+
_body_params = text_classification_v2_payload
|
579
|
+
|
580
|
+
|
581
|
+
# set the HTTP header `Accept`
|
582
|
+
if 'Accept' not in _header_params:
|
583
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
584
|
+
[
|
585
|
+
'*/*'
|
586
|
+
]
|
587
|
+
)
|
588
|
+
|
589
|
+
# set the HTTP header `Content-Type`
|
590
|
+
if _content_type:
|
591
|
+
_header_params['Content-Type'] = _content_type
|
592
|
+
else:
|
593
|
+
_default_content_type = (
|
594
|
+
self.api_client.select_header_content_type(
|
595
|
+
[
|
596
|
+
'application/json'
|
597
|
+
]
|
598
|
+
)
|
599
|
+
)
|
600
|
+
if _default_content_type is not None:
|
601
|
+
_header_params['Content-Type'] = _default_content_type
|
602
|
+
|
603
|
+
# authentication setting
|
604
|
+
_auth_settings: List[str] = [
|
605
|
+
'QAnswer-Api-Key',
|
606
|
+
'Bearer'
|
607
|
+
]
|
608
|
+
|
609
|
+
return self.api_client.param_serialize(
|
610
|
+
method='POST',
|
611
|
+
resource_path='/api/tasks/text-classification/v2',
|
612
|
+
path_params=_path_params,
|
613
|
+
query_params=_query_params,
|
614
|
+
header_params=_header_params,
|
615
|
+
body=_body_params,
|
616
|
+
post_params=_form_params,
|
617
|
+
files=_files,
|
618
|
+
auth_settings=_auth_settings,
|
619
|
+
collection_formats=_collection_formats,
|
620
|
+
_host=_host,
|
621
|
+
_request_auth=_request_auth
|
622
|
+
)
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
|
627
|
+
@validate_call
|
628
|
+
def text_classification(
|
629
|
+
self,
|
630
|
+
text_classification_payload: TextClassificationPayload,
|
631
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
632
|
+
_request_timeout: Union[
|
633
|
+
None,
|
634
|
+
Annotated[StrictFloat, Field(gt=0)],
|
635
|
+
Tuple[
|
636
|
+
Annotated[StrictFloat, Field(gt=0)],
|
637
|
+
Annotated[StrictFloat, Field(gt=0)]
|
638
|
+
]
|
639
|
+
] = None,
|
640
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
641
|
+
_content_type: Optional[StrictStr] = None,
|
642
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
643
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
644
|
+
) -> TextClassificationResponse:
|
645
|
+
"""V1: single-class
|
646
|
+
|
647
|
+
Text classification with single-class support
|
648
|
+
|
649
|
+
:param text_classification_payload: (required)
|
650
|
+
:type text_classification_payload: TextClassificationPayload
|
651
|
+
:param q_answer_api_key:
|
652
|
+
:type q_answer_api_key: str
|
653
|
+
:param _request_timeout: timeout setting for this request. If one
|
654
|
+
number provided, it will be total request
|
655
|
+
timeout. It can also be a pair (tuple) of
|
656
|
+
(connection, read) timeouts.
|
657
|
+
:type _request_timeout: int, tuple(int, int), optional
|
658
|
+
:param _request_auth: set to override the auth_settings for an a single
|
659
|
+
request; this effectively ignores the
|
660
|
+
authentication in the spec for a single request.
|
661
|
+
:type _request_auth: dict, optional
|
662
|
+
:param _content_type: force content-type for the request.
|
663
|
+
:type _content_type: str, Optional
|
664
|
+
:param _headers: set to override the headers for a single
|
665
|
+
request; this effectively ignores the headers
|
666
|
+
in the spec for a single request.
|
667
|
+
:type _headers: dict, optional
|
668
|
+
:param _host_index: set to override the host_index for a single
|
669
|
+
request; this effectively ignores the host_index
|
670
|
+
in the spec for a single request.
|
671
|
+
:type _host_index: int, optional
|
672
|
+
:return: Returns the result object.
|
673
|
+
""" # noqa: E501
|
674
|
+
|
675
|
+
_param = self._text_classification_serialize(
|
676
|
+
text_classification_payload=text_classification_payload,
|
677
|
+
q_answer_api_key=q_answer_api_key,
|
678
|
+
_request_auth=_request_auth,
|
679
|
+
_content_type=_content_type,
|
680
|
+
_headers=_headers,
|
681
|
+
_host_index=_host_index
|
682
|
+
)
|
683
|
+
|
684
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
685
|
+
'200': "TextClassificationResponse",
|
686
|
+
}
|
687
|
+
response_data = self.api_client.call_api(
|
688
|
+
*_param,
|
689
|
+
_request_timeout=_request_timeout
|
690
|
+
)
|
691
|
+
response_data.read()
|
692
|
+
return self.api_client.response_deserialize(
|
693
|
+
response_data=response_data,
|
694
|
+
response_types_map=_response_types_map,
|
695
|
+
).data
|
696
|
+
|
697
|
+
|
698
|
+
@validate_call
|
699
|
+
def text_classification_with_http_info(
|
700
|
+
self,
|
701
|
+
text_classification_payload: TextClassificationPayload,
|
702
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
703
|
+
_request_timeout: Union[
|
704
|
+
None,
|
705
|
+
Annotated[StrictFloat, Field(gt=0)],
|
706
|
+
Tuple[
|
707
|
+
Annotated[StrictFloat, Field(gt=0)],
|
708
|
+
Annotated[StrictFloat, Field(gt=0)]
|
709
|
+
]
|
710
|
+
] = None,
|
711
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
712
|
+
_content_type: Optional[StrictStr] = None,
|
713
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
714
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
715
|
+
) -> ApiResponse[TextClassificationResponse]:
|
716
|
+
"""V1: single-class
|
717
|
+
|
718
|
+
Text classification with single-class support
|
719
|
+
|
720
|
+
:param text_classification_payload: (required)
|
721
|
+
:type text_classification_payload: TextClassificationPayload
|
722
|
+
:param q_answer_api_key:
|
723
|
+
:type q_answer_api_key: str
|
724
|
+
:param _request_timeout: timeout setting for this request. If one
|
725
|
+
number provided, it will be total request
|
726
|
+
timeout. It can also be a pair (tuple) of
|
727
|
+
(connection, read) timeouts.
|
728
|
+
:type _request_timeout: int, tuple(int, int), optional
|
729
|
+
:param _request_auth: set to override the auth_settings for an a single
|
730
|
+
request; this effectively ignores the
|
731
|
+
authentication in the spec for a single request.
|
732
|
+
:type _request_auth: dict, optional
|
733
|
+
:param _content_type: force content-type for the request.
|
734
|
+
:type _content_type: str, Optional
|
735
|
+
:param _headers: set to override the headers for a single
|
736
|
+
request; this effectively ignores the headers
|
737
|
+
in the spec for a single request.
|
738
|
+
:type _headers: dict, optional
|
739
|
+
:param _host_index: set to override the host_index for a single
|
740
|
+
request; this effectively ignores the host_index
|
741
|
+
in the spec for a single request.
|
742
|
+
:type _host_index: int, optional
|
743
|
+
:return: Returns the result object.
|
744
|
+
""" # noqa: E501
|
745
|
+
|
746
|
+
_param = self._text_classification_serialize(
|
747
|
+
text_classification_payload=text_classification_payload,
|
748
|
+
q_answer_api_key=q_answer_api_key,
|
749
|
+
_request_auth=_request_auth,
|
750
|
+
_content_type=_content_type,
|
751
|
+
_headers=_headers,
|
752
|
+
_host_index=_host_index
|
753
|
+
)
|
754
|
+
|
755
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
756
|
+
'200': "TextClassificationResponse",
|
757
|
+
}
|
758
|
+
response_data = self.api_client.call_api(
|
759
|
+
*_param,
|
760
|
+
_request_timeout=_request_timeout
|
761
|
+
)
|
762
|
+
response_data.read()
|
763
|
+
return self.api_client.response_deserialize(
|
764
|
+
response_data=response_data,
|
765
|
+
response_types_map=_response_types_map,
|
766
|
+
)
|
767
|
+
|
768
|
+
|
769
|
+
@validate_call
|
770
|
+
def text_classification_without_preload_content(
|
771
|
+
self,
|
772
|
+
text_classification_payload: TextClassificationPayload,
|
773
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
774
|
+
_request_timeout: Union[
|
775
|
+
None,
|
776
|
+
Annotated[StrictFloat, Field(gt=0)],
|
777
|
+
Tuple[
|
778
|
+
Annotated[StrictFloat, Field(gt=0)],
|
779
|
+
Annotated[StrictFloat, Field(gt=0)]
|
780
|
+
]
|
781
|
+
] = None,
|
782
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
783
|
+
_content_type: Optional[StrictStr] = None,
|
784
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
785
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
786
|
+
) -> RESTResponseType:
|
787
|
+
"""V1: single-class
|
788
|
+
|
789
|
+
Text classification with single-class support
|
790
|
+
|
791
|
+
:param text_classification_payload: (required)
|
792
|
+
:type text_classification_payload: TextClassificationPayload
|
793
|
+
:param q_answer_api_key:
|
794
|
+
:type q_answer_api_key: str
|
795
|
+
:param _request_timeout: timeout setting for this request. If one
|
796
|
+
number provided, it will be total request
|
797
|
+
timeout. It can also be a pair (tuple) of
|
798
|
+
(connection, read) timeouts.
|
799
|
+
:type _request_timeout: int, tuple(int, int), optional
|
800
|
+
:param _request_auth: set to override the auth_settings for an a single
|
801
|
+
request; this effectively ignores the
|
802
|
+
authentication in the spec for a single request.
|
803
|
+
:type _request_auth: dict, optional
|
804
|
+
:param _content_type: force content-type for the request.
|
805
|
+
:type _content_type: str, Optional
|
806
|
+
:param _headers: set to override the headers for a single
|
807
|
+
request; this effectively ignores the headers
|
808
|
+
in the spec for a single request.
|
809
|
+
:type _headers: dict, optional
|
810
|
+
:param _host_index: set to override the host_index for a single
|
811
|
+
request; this effectively ignores the host_index
|
812
|
+
in the spec for a single request.
|
813
|
+
:type _host_index: int, optional
|
814
|
+
:return: Returns the result object.
|
815
|
+
""" # noqa: E501
|
816
|
+
|
817
|
+
_param = self._text_classification_serialize(
|
818
|
+
text_classification_payload=text_classification_payload,
|
819
|
+
q_answer_api_key=q_answer_api_key,
|
820
|
+
_request_auth=_request_auth,
|
821
|
+
_content_type=_content_type,
|
822
|
+
_headers=_headers,
|
823
|
+
_host_index=_host_index
|
824
|
+
)
|
825
|
+
|
826
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
827
|
+
'200': "TextClassificationResponse",
|
828
|
+
}
|
829
|
+
response_data = self.api_client.call_api(
|
830
|
+
*_param,
|
831
|
+
_request_timeout=_request_timeout
|
832
|
+
)
|
833
|
+
return response_data.response
|
834
|
+
|
835
|
+
|
836
|
+
def _text_classification_serialize(
|
837
|
+
self,
|
838
|
+
text_classification_payload,
|
839
|
+
q_answer_api_key,
|
840
|
+
_request_auth,
|
841
|
+
_content_type,
|
842
|
+
_headers,
|
843
|
+
_host_index,
|
844
|
+
) -> RequestSerialized:
|
845
|
+
|
846
|
+
_host = None
|
847
|
+
|
848
|
+
_collection_formats: Dict[str, str] = {
|
849
|
+
}
|
850
|
+
|
851
|
+
_path_params: Dict[str, str] = {}
|
852
|
+
_query_params: List[Tuple[str, str]] = []
|
853
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
854
|
+
_form_params: List[Tuple[str, str]] = []
|
855
|
+
_files: Dict[
|
856
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
857
|
+
] = {}
|
858
|
+
_body_params: Optional[bytes] = None
|
859
|
+
|
860
|
+
# process the path parameters
|
861
|
+
# process the query parameters
|
862
|
+
# process the header parameters
|
863
|
+
if q_answer_api_key is not None:
|
864
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
865
|
+
# process the form parameters
|
866
|
+
# process the body parameter
|
867
|
+
if text_classification_payload is not None:
|
868
|
+
_body_params = text_classification_payload
|
869
|
+
|
870
|
+
|
871
|
+
# set the HTTP header `Accept`
|
872
|
+
if 'Accept' not in _header_params:
|
873
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
874
|
+
[
|
875
|
+
'*/*'
|
876
|
+
]
|
877
|
+
)
|
878
|
+
|
879
|
+
# set the HTTP header `Content-Type`
|
880
|
+
if _content_type:
|
881
|
+
_header_params['Content-Type'] = _content_type
|
882
|
+
else:
|
883
|
+
_default_content_type = (
|
884
|
+
self.api_client.select_header_content_type(
|
885
|
+
[
|
886
|
+
'application/json'
|
887
|
+
]
|
888
|
+
)
|
889
|
+
)
|
890
|
+
if _default_content_type is not None:
|
891
|
+
_header_params['Content-Type'] = _default_content_type
|
892
|
+
|
893
|
+
# authentication setting
|
894
|
+
_auth_settings: List[str] = [
|
895
|
+
'QAnswer-Api-Key',
|
896
|
+
'Bearer'
|
897
|
+
]
|
898
|
+
|
899
|
+
return self.api_client.param_serialize(
|
900
|
+
method='POST',
|
901
|
+
resource_path='/api/tasks/text-classification',
|
902
|
+
path_params=_path_params,
|
903
|
+
query_params=_query_params,
|
904
|
+
header_params=_header_params,
|
905
|
+
body=_body_params,
|
906
|
+
post_params=_form_params,
|
907
|
+
files=_files,
|
908
|
+
auth_settings=_auth_settings,
|
909
|
+
collection_formats=_collection_formats,
|
910
|
+
_host=_host,
|
911
|
+
_request_auth=_request_auth
|
912
|
+
)
|
913
|
+
|
914
|
+
|