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,1784 @@
|
|
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, field_validator
|
20
|
+
from typing import Dict, List, Optional
|
21
|
+
from qanswer_sdk.models.aggregations_group import AggregationsGroup
|
22
|
+
from qanswer_sdk.models.rag_payload import RAGPayload
|
23
|
+
from qanswer_sdk.models.rag_response import RAGResponse
|
24
|
+
from qanswer_sdk.models.search_payload import SearchPayload
|
25
|
+
from qanswer_sdk.models.search_response import SearchResponse
|
26
|
+
from qanswer_sdk.models.search_task_settings import SearchTaskSettings
|
27
|
+
from qanswer_sdk.models.search_task_settings_update_payload import SearchTaskSettingsUpdatePayload
|
28
|
+
|
29
|
+
from qanswer_sdk.api_client import ApiClient, RequestSerialized
|
30
|
+
from qanswer_sdk.api_response import ApiResponse
|
31
|
+
from qanswer_sdk.rest import RESTResponseType
|
32
|
+
|
33
|
+
|
34
|
+
class TaskSearchApi:
|
35
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
36
|
+
Ref: https://openapi-generator.tech
|
37
|
+
|
38
|
+
Do not edit the class manually.
|
39
|
+
"""
|
40
|
+
|
41
|
+
def __init__(self, api_client=None) -> None:
|
42
|
+
if api_client is None:
|
43
|
+
api_client = ApiClient.get_default()
|
44
|
+
self.api_client = api_client
|
45
|
+
|
46
|
+
|
47
|
+
@validate_call
|
48
|
+
def free_text_search_task_read_settings(
|
49
|
+
self,
|
50
|
+
username: StrictStr,
|
51
|
+
dataset: StrictStr,
|
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
|
+
) -> SearchTaskSettings:
|
66
|
+
"""This reads the settings of the search/generate task
|
67
|
+
|
68
|
+
|
69
|
+
:param username: (required)
|
70
|
+
:type username: str
|
71
|
+
:param dataset: (required)
|
72
|
+
:type dataset: str
|
73
|
+
:param q_answer_api_key:
|
74
|
+
:type q_answer_api_key: str
|
75
|
+
:param _request_timeout: timeout setting for this request. If one
|
76
|
+
number provided, it will be total request
|
77
|
+
timeout. It can also be a pair (tuple) of
|
78
|
+
(connection, read) timeouts.
|
79
|
+
:type _request_timeout: int, tuple(int, int), optional
|
80
|
+
:param _request_auth: set to override the auth_settings for an a single
|
81
|
+
request; this effectively ignores the
|
82
|
+
authentication in the spec for a single request.
|
83
|
+
:type _request_auth: dict, optional
|
84
|
+
:param _content_type: force content-type for the request.
|
85
|
+
:type _content_type: str, Optional
|
86
|
+
:param _headers: set to override the headers for a single
|
87
|
+
request; this effectively ignores the headers
|
88
|
+
in the spec for a single request.
|
89
|
+
:type _headers: dict, optional
|
90
|
+
:param _host_index: set to override the host_index for a single
|
91
|
+
request; this effectively ignores the host_index
|
92
|
+
in the spec for a single request.
|
93
|
+
:type _host_index: int, optional
|
94
|
+
:return: Returns the result object.
|
95
|
+
""" # noqa: E501
|
96
|
+
|
97
|
+
_param = self._free_text_search_task_read_settings_serialize(
|
98
|
+
username=username,
|
99
|
+
dataset=dataset,
|
100
|
+
q_answer_api_key=q_answer_api_key,
|
101
|
+
_request_auth=_request_auth,
|
102
|
+
_content_type=_content_type,
|
103
|
+
_headers=_headers,
|
104
|
+
_host_index=_host_index
|
105
|
+
)
|
106
|
+
|
107
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
108
|
+
'200': "SearchTaskSettings",
|
109
|
+
}
|
110
|
+
response_data = self.api_client.call_api(
|
111
|
+
*_param,
|
112
|
+
_request_timeout=_request_timeout
|
113
|
+
)
|
114
|
+
response_data.read()
|
115
|
+
return self.api_client.response_deserialize(
|
116
|
+
response_data=response_data,
|
117
|
+
response_types_map=_response_types_map,
|
118
|
+
).data
|
119
|
+
|
120
|
+
|
121
|
+
@validate_call
|
122
|
+
def free_text_search_task_read_settings_with_http_info(
|
123
|
+
self,
|
124
|
+
username: StrictStr,
|
125
|
+
dataset: StrictStr,
|
126
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
127
|
+
_request_timeout: Union[
|
128
|
+
None,
|
129
|
+
Annotated[StrictFloat, Field(gt=0)],
|
130
|
+
Tuple[
|
131
|
+
Annotated[StrictFloat, Field(gt=0)],
|
132
|
+
Annotated[StrictFloat, Field(gt=0)]
|
133
|
+
]
|
134
|
+
] = None,
|
135
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
136
|
+
_content_type: Optional[StrictStr] = None,
|
137
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
138
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
139
|
+
) -> ApiResponse[SearchTaskSettings]:
|
140
|
+
"""This reads the settings of the search/generate task
|
141
|
+
|
142
|
+
|
143
|
+
:param username: (required)
|
144
|
+
:type username: str
|
145
|
+
:param dataset: (required)
|
146
|
+
:type dataset: str
|
147
|
+
:param q_answer_api_key:
|
148
|
+
:type q_answer_api_key: str
|
149
|
+
:param _request_timeout: timeout setting for this request. If one
|
150
|
+
number provided, it will be total request
|
151
|
+
timeout. It can also be a pair (tuple) of
|
152
|
+
(connection, read) timeouts.
|
153
|
+
:type _request_timeout: int, tuple(int, int), optional
|
154
|
+
:param _request_auth: set to override the auth_settings for an a single
|
155
|
+
request; this effectively ignores the
|
156
|
+
authentication in the spec for a single request.
|
157
|
+
:type _request_auth: dict, optional
|
158
|
+
:param _content_type: force content-type for the request.
|
159
|
+
:type _content_type: str, Optional
|
160
|
+
:param _headers: set to override the headers for a single
|
161
|
+
request; this effectively ignores the headers
|
162
|
+
in the spec for a single request.
|
163
|
+
:type _headers: dict, optional
|
164
|
+
:param _host_index: set to override the host_index for a single
|
165
|
+
request; this effectively ignores the host_index
|
166
|
+
in the spec for a single request.
|
167
|
+
:type _host_index: int, optional
|
168
|
+
:return: Returns the result object.
|
169
|
+
""" # noqa: E501
|
170
|
+
|
171
|
+
_param = self._free_text_search_task_read_settings_serialize(
|
172
|
+
username=username,
|
173
|
+
dataset=dataset,
|
174
|
+
q_answer_api_key=q_answer_api_key,
|
175
|
+
_request_auth=_request_auth,
|
176
|
+
_content_type=_content_type,
|
177
|
+
_headers=_headers,
|
178
|
+
_host_index=_host_index
|
179
|
+
)
|
180
|
+
|
181
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
182
|
+
'200': "SearchTaskSettings",
|
183
|
+
}
|
184
|
+
response_data = self.api_client.call_api(
|
185
|
+
*_param,
|
186
|
+
_request_timeout=_request_timeout
|
187
|
+
)
|
188
|
+
response_data.read()
|
189
|
+
return self.api_client.response_deserialize(
|
190
|
+
response_data=response_data,
|
191
|
+
response_types_map=_response_types_map,
|
192
|
+
)
|
193
|
+
|
194
|
+
|
195
|
+
@validate_call
|
196
|
+
def free_text_search_task_read_settings_without_preload_content(
|
197
|
+
self,
|
198
|
+
username: StrictStr,
|
199
|
+
dataset: StrictStr,
|
200
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
201
|
+
_request_timeout: Union[
|
202
|
+
None,
|
203
|
+
Annotated[StrictFloat, Field(gt=0)],
|
204
|
+
Tuple[
|
205
|
+
Annotated[StrictFloat, Field(gt=0)],
|
206
|
+
Annotated[StrictFloat, Field(gt=0)]
|
207
|
+
]
|
208
|
+
] = None,
|
209
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
210
|
+
_content_type: Optional[StrictStr] = None,
|
211
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
212
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
213
|
+
) -> RESTResponseType:
|
214
|
+
"""This reads the settings of the search/generate task
|
215
|
+
|
216
|
+
|
217
|
+
:param username: (required)
|
218
|
+
:type username: str
|
219
|
+
:param dataset: (required)
|
220
|
+
:type dataset: str
|
221
|
+
:param q_answer_api_key:
|
222
|
+
:type q_answer_api_key: str
|
223
|
+
:param _request_timeout: timeout setting for this request. If one
|
224
|
+
number provided, it will be total request
|
225
|
+
timeout. It can also be a pair (tuple) of
|
226
|
+
(connection, read) timeouts.
|
227
|
+
:type _request_timeout: int, tuple(int, int), optional
|
228
|
+
:param _request_auth: set to override the auth_settings for an a single
|
229
|
+
request; this effectively ignores the
|
230
|
+
authentication in the spec for a single request.
|
231
|
+
:type _request_auth: dict, optional
|
232
|
+
:param _content_type: force content-type for the request.
|
233
|
+
:type _content_type: str, Optional
|
234
|
+
:param _headers: set to override the headers for a single
|
235
|
+
request; this effectively ignores the headers
|
236
|
+
in the spec for a single request.
|
237
|
+
:type _headers: dict, optional
|
238
|
+
:param _host_index: set to override the host_index for a single
|
239
|
+
request; this effectively ignores the host_index
|
240
|
+
in the spec for a single request.
|
241
|
+
:type _host_index: int, optional
|
242
|
+
:return: Returns the result object.
|
243
|
+
""" # noqa: E501
|
244
|
+
|
245
|
+
_param = self._free_text_search_task_read_settings_serialize(
|
246
|
+
username=username,
|
247
|
+
dataset=dataset,
|
248
|
+
q_answer_api_key=q_answer_api_key,
|
249
|
+
_request_auth=_request_auth,
|
250
|
+
_content_type=_content_type,
|
251
|
+
_headers=_headers,
|
252
|
+
_host_index=_host_index
|
253
|
+
)
|
254
|
+
|
255
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
256
|
+
'200': "SearchTaskSettings",
|
257
|
+
}
|
258
|
+
response_data = self.api_client.call_api(
|
259
|
+
*_param,
|
260
|
+
_request_timeout=_request_timeout
|
261
|
+
)
|
262
|
+
return response_data.response
|
263
|
+
|
264
|
+
|
265
|
+
def _free_text_search_task_read_settings_serialize(
|
266
|
+
self,
|
267
|
+
username,
|
268
|
+
dataset,
|
269
|
+
q_answer_api_key,
|
270
|
+
_request_auth,
|
271
|
+
_content_type,
|
272
|
+
_headers,
|
273
|
+
_host_index,
|
274
|
+
) -> RequestSerialized:
|
275
|
+
|
276
|
+
_host = None
|
277
|
+
|
278
|
+
_collection_formats: Dict[str, str] = {
|
279
|
+
}
|
280
|
+
|
281
|
+
_path_params: Dict[str, str] = {}
|
282
|
+
_query_params: List[Tuple[str, str]] = []
|
283
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
284
|
+
_form_params: List[Tuple[str, str]] = []
|
285
|
+
_files: Dict[
|
286
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
287
|
+
] = {}
|
288
|
+
_body_params: Optional[bytes] = None
|
289
|
+
|
290
|
+
# process the path parameters
|
291
|
+
# process the query parameters
|
292
|
+
if username is not None:
|
293
|
+
|
294
|
+
_query_params.append(('username', username))
|
295
|
+
|
296
|
+
if dataset is not None:
|
297
|
+
|
298
|
+
_query_params.append(('dataset', dataset))
|
299
|
+
|
300
|
+
# process the header parameters
|
301
|
+
if q_answer_api_key is not None:
|
302
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
303
|
+
# process the form parameters
|
304
|
+
# process the body parameter
|
305
|
+
|
306
|
+
|
307
|
+
# set the HTTP header `Accept`
|
308
|
+
if 'Accept' not in _header_params:
|
309
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
310
|
+
[
|
311
|
+
'*/*'
|
312
|
+
]
|
313
|
+
)
|
314
|
+
|
315
|
+
|
316
|
+
# authentication setting
|
317
|
+
_auth_settings: List[str] = [
|
318
|
+
'QAnswer-Api-Key',
|
319
|
+
'Bearer'
|
320
|
+
]
|
321
|
+
|
322
|
+
return self.api_client.param_serialize(
|
323
|
+
method='GET',
|
324
|
+
resource_path='/api/tasks/search/settings',
|
325
|
+
path_params=_path_params,
|
326
|
+
query_params=_query_params,
|
327
|
+
header_params=_header_params,
|
328
|
+
body=_body_params,
|
329
|
+
post_params=_form_params,
|
330
|
+
files=_files,
|
331
|
+
auth_settings=_auth_settings,
|
332
|
+
collection_formats=_collection_formats,
|
333
|
+
_host=_host,
|
334
|
+
_request_auth=_request_auth
|
335
|
+
)
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
@validate_call
|
341
|
+
def free_text_search_task_update_settings(
|
342
|
+
self,
|
343
|
+
search_task_settings_update_payload: SearchTaskSettingsUpdatePayload,
|
344
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
345
|
+
_request_timeout: Union[
|
346
|
+
None,
|
347
|
+
Annotated[StrictFloat, Field(gt=0)],
|
348
|
+
Tuple[
|
349
|
+
Annotated[StrictFloat, Field(gt=0)],
|
350
|
+
Annotated[StrictFloat, Field(gt=0)]
|
351
|
+
]
|
352
|
+
] = None,
|
353
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
354
|
+
_content_type: Optional[StrictStr] = None,
|
355
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
356
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
357
|
+
) -> SearchTaskSettings:
|
358
|
+
"""This updates the settings of the search/generate task
|
359
|
+
|
360
|
+
|
361
|
+
:param search_task_settings_update_payload: (required)
|
362
|
+
:type search_task_settings_update_payload: SearchTaskSettingsUpdatePayload
|
363
|
+
:param q_answer_api_key:
|
364
|
+
:type q_answer_api_key: str
|
365
|
+
:param _request_timeout: timeout setting for this request. If one
|
366
|
+
number provided, it will be total request
|
367
|
+
timeout. It can also be a pair (tuple) of
|
368
|
+
(connection, read) timeouts.
|
369
|
+
:type _request_timeout: int, tuple(int, int), optional
|
370
|
+
:param _request_auth: set to override the auth_settings for an a single
|
371
|
+
request; this effectively ignores the
|
372
|
+
authentication in the spec for a single request.
|
373
|
+
:type _request_auth: dict, optional
|
374
|
+
:param _content_type: force content-type for the request.
|
375
|
+
:type _content_type: str, Optional
|
376
|
+
:param _headers: set to override the headers for a single
|
377
|
+
request; this effectively ignores the headers
|
378
|
+
in the spec for a single request.
|
379
|
+
:type _headers: dict, optional
|
380
|
+
:param _host_index: set to override the host_index for a single
|
381
|
+
request; this effectively ignores the host_index
|
382
|
+
in the spec for a single request.
|
383
|
+
:type _host_index: int, optional
|
384
|
+
:return: Returns the result object.
|
385
|
+
""" # noqa: E501
|
386
|
+
|
387
|
+
_param = self._free_text_search_task_update_settings_serialize(
|
388
|
+
search_task_settings_update_payload=search_task_settings_update_payload,
|
389
|
+
q_answer_api_key=q_answer_api_key,
|
390
|
+
_request_auth=_request_auth,
|
391
|
+
_content_type=_content_type,
|
392
|
+
_headers=_headers,
|
393
|
+
_host_index=_host_index
|
394
|
+
)
|
395
|
+
|
396
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
397
|
+
'200': "SearchTaskSettings",
|
398
|
+
}
|
399
|
+
response_data = self.api_client.call_api(
|
400
|
+
*_param,
|
401
|
+
_request_timeout=_request_timeout
|
402
|
+
)
|
403
|
+
response_data.read()
|
404
|
+
return self.api_client.response_deserialize(
|
405
|
+
response_data=response_data,
|
406
|
+
response_types_map=_response_types_map,
|
407
|
+
).data
|
408
|
+
|
409
|
+
|
410
|
+
@validate_call
|
411
|
+
def free_text_search_task_update_settings_with_http_info(
|
412
|
+
self,
|
413
|
+
search_task_settings_update_payload: SearchTaskSettingsUpdatePayload,
|
414
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
415
|
+
_request_timeout: Union[
|
416
|
+
None,
|
417
|
+
Annotated[StrictFloat, Field(gt=0)],
|
418
|
+
Tuple[
|
419
|
+
Annotated[StrictFloat, Field(gt=0)],
|
420
|
+
Annotated[StrictFloat, Field(gt=0)]
|
421
|
+
]
|
422
|
+
] = None,
|
423
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
424
|
+
_content_type: Optional[StrictStr] = None,
|
425
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
426
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
427
|
+
) -> ApiResponse[SearchTaskSettings]:
|
428
|
+
"""This updates the settings of the search/generate task
|
429
|
+
|
430
|
+
|
431
|
+
:param search_task_settings_update_payload: (required)
|
432
|
+
:type search_task_settings_update_payload: SearchTaskSettingsUpdatePayload
|
433
|
+
:param q_answer_api_key:
|
434
|
+
:type q_answer_api_key: str
|
435
|
+
:param _request_timeout: timeout setting for this request. If one
|
436
|
+
number provided, it will be total request
|
437
|
+
timeout. It can also be a pair (tuple) of
|
438
|
+
(connection, read) timeouts.
|
439
|
+
:type _request_timeout: int, tuple(int, int), optional
|
440
|
+
:param _request_auth: set to override the auth_settings for an a single
|
441
|
+
request; this effectively ignores the
|
442
|
+
authentication in the spec for a single request.
|
443
|
+
:type _request_auth: dict, optional
|
444
|
+
:param _content_type: force content-type for the request.
|
445
|
+
:type _content_type: str, Optional
|
446
|
+
:param _headers: set to override the headers for a single
|
447
|
+
request; this effectively ignores the headers
|
448
|
+
in the spec for a single request.
|
449
|
+
:type _headers: dict, optional
|
450
|
+
:param _host_index: set to override the host_index for a single
|
451
|
+
request; this effectively ignores the host_index
|
452
|
+
in the spec for a single request.
|
453
|
+
:type _host_index: int, optional
|
454
|
+
:return: Returns the result object.
|
455
|
+
""" # noqa: E501
|
456
|
+
|
457
|
+
_param = self._free_text_search_task_update_settings_serialize(
|
458
|
+
search_task_settings_update_payload=search_task_settings_update_payload,
|
459
|
+
q_answer_api_key=q_answer_api_key,
|
460
|
+
_request_auth=_request_auth,
|
461
|
+
_content_type=_content_type,
|
462
|
+
_headers=_headers,
|
463
|
+
_host_index=_host_index
|
464
|
+
)
|
465
|
+
|
466
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
467
|
+
'200': "SearchTaskSettings",
|
468
|
+
}
|
469
|
+
response_data = self.api_client.call_api(
|
470
|
+
*_param,
|
471
|
+
_request_timeout=_request_timeout
|
472
|
+
)
|
473
|
+
response_data.read()
|
474
|
+
return self.api_client.response_deserialize(
|
475
|
+
response_data=response_data,
|
476
|
+
response_types_map=_response_types_map,
|
477
|
+
)
|
478
|
+
|
479
|
+
|
480
|
+
@validate_call
|
481
|
+
def free_text_search_task_update_settings_without_preload_content(
|
482
|
+
self,
|
483
|
+
search_task_settings_update_payload: SearchTaskSettingsUpdatePayload,
|
484
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
485
|
+
_request_timeout: Union[
|
486
|
+
None,
|
487
|
+
Annotated[StrictFloat, Field(gt=0)],
|
488
|
+
Tuple[
|
489
|
+
Annotated[StrictFloat, Field(gt=0)],
|
490
|
+
Annotated[StrictFloat, Field(gt=0)]
|
491
|
+
]
|
492
|
+
] = None,
|
493
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
494
|
+
_content_type: Optional[StrictStr] = None,
|
495
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
496
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
497
|
+
) -> RESTResponseType:
|
498
|
+
"""This updates the settings of the search/generate task
|
499
|
+
|
500
|
+
|
501
|
+
:param search_task_settings_update_payload: (required)
|
502
|
+
:type search_task_settings_update_payload: SearchTaskSettingsUpdatePayload
|
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._free_text_search_task_update_settings_serialize(
|
528
|
+
search_task_settings_update_payload=search_task_settings_update_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': "SearchTaskSettings",
|
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 _free_text_search_task_update_settings_serialize(
|
547
|
+
self,
|
548
|
+
search_task_settings_update_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 search_task_settings_update_payload is not None:
|
578
|
+
_body_params = search_task_settings_update_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='PUT',
|
611
|
+
resource_path='/api/tasks/search/settings',
|
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 get_search_available_aggregations(
|
629
|
+
self,
|
630
|
+
username: StrictStr,
|
631
|
+
dataset: StrictStr,
|
632
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
633
|
+
_request_timeout: Union[
|
634
|
+
None,
|
635
|
+
Annotated[StrictFloat, Field(gt=0)],
|
636
|
+
Tuple[
|
637
|
+
Annotated[StrictFloat, Field(gt=0)],
|
638
|
+
Annotated[StrictFloat, Field(gt=0)]
|
639
|
+
]
|
640
|
+
] = None,
|
641
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
642
|
+
_content_type: Optional[StrictStr] = None,
|
643
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
644
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
645
|
+
) -> Dict[str, str]:
|
646
|
+
"""Check which aggregations are available for the dataset
|
647
|
+
|
648
|
+
|
649
|
+
:param username: (required)
|
650
|
+
:type username: str
|
651
|
+
:param dataset: (required)
|
652
|
+
:type dataset: str
|
653
|
+
:param q_answer_api_key:
|
654
|
+
:type q_answer_api_key: str
|
655
|
+
:param _request_timeout: timeout setting for this request. If one
|
656
|
+
number provided, it will be total request
|
657
|
+
timeout. It can also be a pair (tuple) of
|
658
|
+
(connection, read) timeouts.
|
659
|
+
:type _request_timeout: int, tuple(int, int), optional
|
660
|
+
:param _request_auth: set to override the auth_settings for an a single
|
661
|
+
request; this effectively ignores the
|
662
|
+
authentication in the spec for a single request.
|
663
|
+
:type _request_auth: dict, optional
|
664
|
+
:param _content_type: force content-type for the request.
|
665
|
+
:type _content_type: str, Optional
|
666
|
+
:param _headers: set to override the headers for a single
|
667
|
+
request; this effectively ignores the headers
|
668
|
+
in the spec for a single request.
|
669
|
+
:type _headers: dict, optional
|
670
|
+
:param _host_index: set to override the host_index for a single
|
671
|
+
request; this effectively ignores the host_index
|
672
|
+
in the spec for a single request.
|
673
|
+
:type _host_index: int, optional
|
674
|
+
:return: Returns the result object.
|
675
|
+
""" # noqa: E501
|
676
|
+
|
677
|
+
_param = self._get_search_available_aggregations_serialize(
|
678
|
+
username=username,
|
679
|
+
dataset=dataset,
|
680
|
+
q_answer_api_key=q_answer_api_key,
|
681
|
+
_request_auth=_request_auth,
|
682
|
+
_content_type=_content_type,
|
683
|
+
_headers=_headers,
|
684
|
+
_host_index=_host_index
|
685
|
+
)
|
686
|
+
|
687
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
688
|
+
'200': "Dict[str, str]",
|
689
|
+
}
|
690
|
+
response_data = self.api_client.call_api(
|
691
|
+
*_param,
|
692
|
+
_request_timeout=_request_timeout
|
693
|
+
)
|
694
|
+
response_data.read()
|
695
|
+
return self.api_client.response_deserialize(
|
696
|
+
response_data=response_data,
|
697
|
+
response_types_map=_response_types_map,
|
698
|
+
).data
|
699
|
+
|
700
|
+
|
701
|
+
@validate_call
|
702
|
+
def get_search_available_aggregations_with_http_info(
|
703
|
+
self,
|
704
|
+
username: StrictStr,
|
705
|
+
dataset: StrictStr,
|
706
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
707
|
+
_request_timeout: Union[
|
708
|
+
None,
|
709
|
+
Annotated[StrictFloat, Field(gt=0)],
|
710
|
+
Tuple[
|
711
|
+
Annotated[StrictFloat, Field(gt=0)],
|
712
|
+
Annotated[StrictFloat, Field(gt=0)]
|
713
|
+
]
|
714
|
+
] = None,
|
715
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
716
|
+
_content_type: Optional[StrictStr] = None,
|
717
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
718
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
719
|
+
) -> ApiResponse[Dict[str, str]]:
|
720
|
+
"""Check which aggregations are available for the dataset
|
721
|
+
|
722
|
+
|
723
|
+
:param username: (required)
|
724
|
+
:type username: str
|
725
|
+
:param dataset: (required)
|
726
|
+
:type dataset: str
|
727
|
+
:param q_answer_api_key:
|
728
|
+
:type q_answer_api_key: str
|
729
|
+
:param _request_timeout: timeout setting for this request. If one
|
730
|
+
number provided, it will be total request
|
731
|
+
timeout. It can also be a pair (tuple) of
|
732
|
+
(connection, read) timeouts.
|
733
|
+
:type _request_timeout: int, tuple(int, int), optional
|
734
|
+
:param _request_auth: set to override the auth_settings for an a single
|
735
|
+
request; this effectively ignores the
|
736
|
+
authentication in the spec for a single request.
|
737
|
+
:type _request_auth: dict, optional
|
738
|
+
:param _content_type: force content-type for the request.
|
739
|
+
:type _content_type: str, Optional
|
740
|
+
:param _headers: set to override the headers for a single
|
741
|
+
request; this effectively ignores the headers
|
742
|
+
in the spec for a single request.
|
743
|
+
:type _headers: dict, optional
|
744
|
+
:param _host_index: set to override the host_index for a single
|
745
|
+
request; this effectively ignores the host_index
|
746
|
+
in the spec for a single request.
|
747
|
+
:type _host_index: int, optional
|
748
|
+
:return: Returns the result object.
|
749
|
+
""" # noqa: E501
|
750
|
+
|
751
|
+
_param = self._get_search_available_aggregations_serialize(
|
752
|
+
username=username,
|
753
|
+
dataset=dataset,
|
754
|
+
q_answer_api_key=q_answer_api_key,
|
755
|
+
_request_auth=_request_auth,
|
756
|
+
_content_type=_content_type,
|
757
|
+
_headers=_headers,
|
758
|
+
_host_index=_host_index
|
759
|
+
)
|
760
|
+
|
761
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
762
|
+
'200': "Dict[str, str]",
|
763
|
+
}
|
764
|
+
response_data = self.api_client.call_api(
|
765
|
+
*_param,
|
766
|
+
_request_timeout=_request_timeout
|
767
|
+
)
|
768
|
+
response_data.read()
|
769
|
+
return self.api_client.response_deserialize(
|
770
|
+
response_data=response_data,
|
771
|
+
response_types_map=_response_types_map,
|
772
|
+
)
|
773
|
+
|
774
|
+
|
775
|
+
@validate_call
|
776
|
+
def get_search_available_aggregations_without_preload_content(
|
777
|
+
self,
|
778
|
+
username: StrictStr,
|
779
|
+
dataset: StrictStr,
|
780
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
781
|
+
_request_timeout: Union[
|
782
|
+
None,
|
783
|
+
Annotated[StrictFloat, Field(gt=0)],
|
784
|
+
Tuple[
|
785
|
+
Annotated[StrictFloat, Field(gt=0)],
|
786
|
+
Annotated[StrictFloat, Field(gt=0)]
|
787
|
+
]
|
788
|
+
] = None,
|
789
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
790
|
+
_content_type: Optional[StrictStr] = None,
|
791
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
792
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
793
|
+
) -> RESTResponseType:
|
794
|
+
"""Check which aggregations are available for the dataset
|
795
|
+
|
796
|
+
|
797
|
+
:param username: (required)
|
798
|
+
:type username: str
|
799
|
+
:param dataset: (required)
|
800
|
+
:type dataset: str
|
801
|
+
:param q_answer_api_key:
|
802
|
+
:type q_answer_api_key: str
|
803
|
+
:param _request_timeout: timeout setting for this request. If one
|
804
|
+
number provided, it will be total request
|
805
|
+
timeout. It can also be a pair (tuple) of
|
806
|
+
(connection, read) timeouts.
|
807
|
+
:type _request_timeout: int, tuple(int, int), optional
|
808
|
+
:param _request_auth: set to override the auth_settings for an a single
|
809
|
+
request; this effectively ignores the
|
810
|
+
authentication in the spec for a single request.
|
811
|
+
:type _request_auth: dict, optional
|
812
|
+
:param _content_type: force content-type for the request.
|
813
|
+
:type _content_type: str, Optional
|
814
|
+
:param _headers: set to override the headers for a single
|
815
|
+
request; this effectively ignores the headers
|
816
|
+
in the spec for a single request.
|
817
|
+
:type _headers: dict, optional
|
818
|
+
:param _host_index: set to override the host_index for a single
|
819
|
+
request; this effectively ignores the host_index
|
820
|
+
in the spec for a single request.
|
821
|
+
:type _host_index: int, optional
|
822
|
+
:return: Returns the result object.
|
823
|
+
""" # noqa: E501
|
824
|
+
|
825
|
+
_param = self._get_search_available_aggregations_serialize(
|
826
|
+
username=username,
|
827
|
+
dataset=dataset,
|
828
|
+
q_answer_api_key=q_answer_api_key,
|
829
|
+
_request_auth=_request_auth,
|
830
|
+
_content_type=_content_type,
|
831
|
+
_headers=_headers,
|
832
|
+
_host_index=_host_index
|
833
|
+
)
|
834
|
+
|
835
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
836
|
+
'200': "Dict[str, str]",
|
837
|
+
}
|
838
|
+
response_data = self.api_client.call_api(
|
839
|
+
*_param,
|
840
|
+
_request_timeout=_request_timeout
|
841
|
+
)
|
842
|
+
return response_data.response
|
843
|
+
|
844
|
+
|
845
|
+
def _get_search_available_aggregations_serialize(
|
846
|
+
self,
|
847
|
+
username,
|
848
|
+
dataset,
|
849
|
+
q_answer_api_key,
|
850
|
+
_request_auth,
|
851
|
+
_content_type,
|
852
|
+
_headers,
|
853
|
+
_host_index,
|
854
|
+
) -> RequestSerialized:
|
855
|
+
|
856
|
+
_host = None
|
857
|
+
|
858
|
+
_collection_formats: Dict[str, str] = {
|
859
|
+
}
|
860
|
+
|
861
|
+
_path_params: Dict[str, str] = {}
|
862
|
+
_query_params: List[Tuple[str, str]] = []
|
863
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
864
|
+
_form_params: List[Tuple[str, str]] = []
|
865
|
+
_files: Dict[
|
866
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
867
|
+
] = {}
|
868
|
+
_body_params: Optional[bytes] = None
|
869
|
+
|
870
|
+
# process the path parameters
|
871
|
+
# process the query parameters
|
872
|
+
if username is not None:
|
873
|
+
|
874
|
+
_query_params.append(('username', username))
|
875
|
+
|
876
|
+
if dataset is not None:
|
877
|
+
|
878
|
+
_query_params.append(('dataset', dataset))
|
879
|
+
|
880
|
+
# process the header parameters
|
881
|
+
if q_answer_api_key is not None:
|
882
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
883
|
+
# process the form parameters
|
884
|
+
# process the body parameter
|
885
|
+
|
886
|
+
|
887
|
+
# set the HTTP header `Accept`
|
888
|
+
if 'Accept' not in _header_params:
|
889
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
890
|
+
[
|
891
|
+
'*/*'
|
892
|
+
]
|
893
|
+
)
|
894
|
+
|
895
|
+
|
896
|
+
# authentication setting
|
897
|
+
_auth_settings: List[str] = [
|
898
|
+
'QAnswer-Api-Key',
|
899
|
+
'Bearer'
|
900
|
+
]
|
901
|
+
|
902
|
+
return self.api_client.param_serialize(
|
903
|
+
method='GET',
|
904
|
+
resource_path='/api/tasks/search/available-aggregations',
|
905
|
+
path_params=_path_params,
|
906
|
+
query_params=_query_params,
|
907
|
+
header_params=_header_params,
|
908
|
+
body=_body_params,
|
909
|
+
post_params=_form_params,
|
910
|
+
files=_files,
|
911
|
+
auth_settings=_auth_settings,
|
912
|
+
collection_formats=_collection_formats,
|
913
|
+
_host=_host,
|
914
|
+
_request_auth=_request_auth
|
915
|
+
)
|
916
|
+
|
917
|
+
|
918
|
+
|
919
|
+
|
920
|
+
@validate_call
|
921
|
+
def get_search_default_aggregations(
|
922
|
+
self,
|
923
|
+
username: StrictStr,
|
924
|
+
dataset: StrictStr,
|
925
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
926
|
+
_request_timeout: Union[
|
927
|
+
None,
|
928
|
+
Annotated[StrictFloat, Field(gt=0)],
|
929
|
+
Tuple[
|
930
|
+
Annotated[StrictFloat, Field(gt=0)],
|
931
|
+
Annotated[StrictFloat, Field(gt=0)]
|
932
|
+
]
|
933
|
+
] = None,
|
934
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
935
|
+
_content_type: Optional[StrictStr] = None,
|
936
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
937
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
938
|
+
) -> List[AggregationsGroup]:
|
939
|
+
"""Get the aggregations for the ai assistant
|
940
|
+
|
941
|
+
|
942
|
+
:param username: (required)
|
943
|
+
:type username: str
|
944
|
+
:param dataset: (required)
|
945
|
+
:type dataset: str
|
946
|
+
:param q_answer_api_key:
|
947
|
+
:type q_answer_api_key: str
|
948
|
+
:param _request_timeout: timeout setting for this request. If one
|
949
|
+
number provided, it will be total request
|
950
|
+
timeout. It can also be a pair (tuple) of
|
951
|
+
(connection, read) timeouts.
|
952
|
+
:type _request_timeout: int, tuple(int, int), optional
|
953
|
+
:param _request_auth: set to override the auth_settings for an a single
|
954
|
+
request; this effectively ignores the
|
955
|
+
authentication in the spec for a single request.
|
956
|
+
:type _request_auth: dict, optional
|
957
|
+
:param _content_type: force content-type for the request.
|
958
|
+
:type _content_type: str, Optional
|
959
|
+
:param _headers: set to override the headers for a single
|
960
|
+
request; this effectively ignores the headers
|
961
|
+
in the spec for a single request.
|
962
|
+
:type _headers: dict, optional
|
963
|
+
:param _host_index: set to override the host_index for a single
|
964
|
+
request; this effectively ignores the host_index
|
965
|
+
in the spec for a single request.
|
966
|
+
:type _host_index: int, optional
|
967
|
+
:return: Returns the result object.
|
968
|
+
""" # noqa: E501
|
969
|
+
|
970
|
+
_param = self._get_search_default_aggregations_serialize(
|
971
|
+
username=username,
|
972
|
+
dataset=dataset,
|
973
|
+
q_answer_api_key=q_answer_api_key,
|
974
|
+
_request_auth=_request_auth,
|
975
|
+
_content_type=_content_type,
|
976
|
+
_headers=_headers,
|
977
|
+
_host_index=_host_index
|
978
|
+
)
|
979
|
+
|
980
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
981
|
+
'200': "List[AggregationsGroup]",
|
982
|
+
}
|
983
|
+
response_data = self.api_client.call_api(
|
984
|
+
*_param,
|
985
|
+
_request_timeout=_request_timeout
|
986
|
+
)
|
987
|
+
response_data.read()
|
988
|
+
return self.api_client.response_deserialize(
|
989
|
+
response_data=response_data,
|
990
|
+
response_types_map=_response_types_map,
|
991
|
+
).data
|
992
|
+
|
993
|
+
|
994
|
+
@validate_call
|
995
|
+
def get_search_default_aggregations_with_http_info(
|
996
|
+
self,
|
997
|
+
username: StrictStr,
|
998
|
+
dataset: StrictStr,
|
999
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1000
|
+
_request_timeout: Union[
|
1001
|
+
None,
|
1002
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1003
|
+
Tuple[
|
1004
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1005
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1006
|
+
]
|
1007
|
+
] = None,
|
1008
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1009
|
+
_content_type: Optional[StrictStr] = None,
|
1010
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1011
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1012
|
+
) -> ApiResponse[List[AggregationsGroup]]:
|
1013
|
+
"""Get the aggregations for the ai assistant
|
1014
|
+
|
1015
|
+
|
1016
|
+
:param username: (required)
|
1017
|
+
:type username: str
|
1018
|
+
:param dataset: (required)
|
1019
|
+
:type dataset: str
|
1020
|
+
:param q_answer_api_key:
|
1021
|
+
:type q_answer_api_key: str
|
1022
|
+
:param _request_timeout: timeout setting for this request. If one
|
1023
|
+
number provided, it will be total request
|
1024
|
+
timeout. It can also be a pair (tuple) of
|
1025
|
+
(connection, read) timeouts.
|
1026
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1027
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1028
|
+
request; this effectively ignores the
|
1029
|
+
authentication in the spec for a single request.
|
1030
|
+
:type _request_auth: dict, optional
|
1031
|
+
:param _content_type: force content-type for the request.
|
1032
|
+
:type _content_type: str, Optional
|
1033
|
+
:param _headers: set to override the headers for a single
|
1034
|
+
request; this effectively ignores the headers
|
1035
|
+
in the spec for a single request.
|
1036
|
+
:type _headers: dict, optional
|
1037
|
+
:param _host_index: set to override the host_index for a single
|
1038
|
+
request; this effectively ignores the host_index
|
1039
|
+
in the spec for a single request.
|
1040
|
+
:type _host_index: int, optional
|
1041
|
+
:return: Returns the result object.
|
1042
|
+
""" # noqa: E501
|
1043
|
+
|
1044
|
+
_param = self._get_search_default_aggregations_serialize(
|
1045
|
+
username=username,
|
1046
|
+
dataset=dataset,
|
1047
|
+
q_answer_api_key=q_answer_api_key,
|
1048
|
+
_request_auth=_request_auth,
|
1049
|
+
_content_type=_content_type,
|
1050
|
+
_headers=_headers,
|
1051
|
+
_host_index=_host_index
|
1052
|
+
)
|
1053
|
+
|
1054
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1055
|
+
'200': "List[AggregationsGroup]",
|
1056
|
+
}
|
1057
|
+
response_data = self.api_client.call_api(
|
1058
|
+
*_param,
|
1059
|
+
_request_timeout=_request_timeout
|
1060
|
+
)
|
1061
|
+
response_data.read()
|
1062
|
+
return self.api_client.response_deserialize(
|
1063
|
+
response_data=response_data,
|
1064
|
+
response_types_map=_response_types_map,
|
1065
|
+
)
|
1066
|
+
|
1067
|
+
|
1068
|
+
@validate_call
|
1069
|
+
def get_search_default_aggregations_without_preload_content(
|
1070
|
+
self,
|
1071
|
+
username: StrictStr,
|
1072
|
+
dataset: StrictStr,
|
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
|
+
"""Get the aggregations for the ai assistant
|
1088
|
+
|
1089
|
+
|
1090
|
+
:param username: (required)
|
1091
|
+
:type username: str
|
1092
|
+
:param dataset: (required)
|
1093
|
+
:type dataset: str
|
1094
|
+
:param q_answer_api_key:
|
1095
|
+
:type q_answer_api_key: str
|
1096
|
+
:param _request_timeout: timeout setting for this request. If one
|
1097
|
+
number provided, it will be total request
|
1098
|
+
timeout. It can also be a pair (tuple) of
|
1099
|
+
(connection, read) timeouts.
|
1100
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1101
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1102
|
+
request; this effectively ignores the
|
1103
|
+
authentication in the spec for a single request.
|
1104
|
+
:type _request_auth: dict, optional
|
1105
|
+
:param _content_type: force content-type for the request.
|
1106
|
+
:type _content_type: str, Optional
|
1107
|
+
:param _headers: set to override the headers for a single
|
1108
|
+
request; this effectively ignores the headers
|
1109
|
+
in the spec for a single request.
|
1110
|
+
:type _headers: dict, optional
|
1111
|
+
:param _host_index: set to override the host_index for a single
|
1112
|
+
request; this effectively ignores the host_index
|
1113
|
+
in the spec for a single request.
|
1114
|
+
:type _host_index: int, optional
|
1115
|
+
:return: Returns the result object.
|
1116
|
+
""" # noqa: E501
|
1117
|
+
|
1118
|
+
_param = self._get_search_default_aggregations_serialize(
|
1119
|
+
username=username,
|
1120
|
+
dataset=dataset,
|
1121
|
+
q_answer_api_key=q_answer_api_key,
|
1122
|
+
_request_auth=_request_auth,
|
1123
|
+
_content_type=_content_type,
|
1124
|
+
_headers=_headers,
|
1125
|
+
_host_index=_host_index
|
1126
|
+
)
|
1127
|
+
|
1128
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1129
|
+
'200': "List[AggregationsGroup]",
|
1130
|
+
}
|
1131
|
+
response_data = self.api_client.call_api(
|
1132
|
+
*_param,
|
1133
|
+
_request_timeout=_request_timeout
|
1134
|
+
)
|
1135
|
+
return response_data.response
|
1136
|
+
|
1137
|
+
|
1138
|
+
def _get_search_default_aggregations_serialize(
|
1139
|
+
self,
|
1140
|
+
username,
|
1141
|
+
dataset,
|
1142
|
+
q_answer_api_key,
|
1143
|
+
_request_auth,
|
1144
|
+
_content_type,
|
1145
|
+
_headers,
|
1146
|
+
_host_index,
|
1147
|
+
) -> RequestSerialized:
|
1148
|
+
|
1149
|
+
_host = None
|
1150
|
+
|
1151
|
+
_collection_formats: Dict[str, str] = {
|
1152
|
+
}
|
1153
|
+
|
1154
|
+
_path_params: Dict[str, str] = {}
|
1155
|
+
_query_params: List[Tuple[str, str]] = []
|
1156
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1157
|
+
_form_params: List[Tuple[str, str]] = []
|
1158
|
+
_files: Dict[
|
1159
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1160
|
+
] = {}
|
1161
|
+
_body_params: Optional[bytes] = None
|
1162
|
+
|
1163
|
+
# process the path parameters
|
1164
|
+
# process the query parameters
|
1165
|
+
if username is not None:
|
1166
|
+
|
1167
|
+
_query_params.append(('username', username))
|
1168
|
+
|
1169
|
+
if dataset is not None:
|
1170
|
+
|
1171
|
+
_query_params.append(('dataset', dataset))
|
1172
|
+
|
1173
|
+
# process the header parameters
|
1174
|
+
if q_answer_api_key is not None:
|
1175
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
1176
|
+
# process the form parameters
|
1177
|
+
# process the body parameter
|
1178
|
+
|
1179
|
+
|
1180
|
+
# set the HTTP header `Accept`
|
1181
|
+
if 'Accept' not in _header_params:
|
1182
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1183
|
+
[
|
1184
|
+
'*/*'
|
1185
|
+
]
|
1186
|
+
)
|
1187
|
+
|
1188
|
+
|
1189
|
+
# authentication setting
|
1190
|
+
_auth_settings: List[str] = [
|
1191
|
+
'QAnswer-Api-Key',
|
1192
|
+
'Bearer'
|
1193
|
+
]
|
1194
|
+
|
1195
|
+
return self.api_client.param_serialize(
|
1196
|
+
method='GET',
|
1197
|
+
resource_path='/api/tasks/search/default-aggregations',
|
1198
|
+
path_params=_path_params,
|
1199
|
+
query_params=_query_params,
|
1200
|
+
header_params=_header_params,
|
1201
|
+
body=_body_params,
|
1202
|
+
post_params=_form_params,
|
1203
|
+
files=_files,
|
1204
|
+
auth_settings=_auth_settings,
|
1205
|
+
collection_formats=_collection_formats,
|
1206
|
+
_host=_host,
|
1207
|
+
_request_auth=_request_auth
|
1208
|
+
)
|
1209
|
+
|
1210
|
+
|
1211
|
+
|
1212
|
+
|
1213
|
+
@validate_call
|
1214
|
+
def search_on_dataset(
|
1215
|
+
self,
|
1216
|
+
search_payload: SearchPayload,
|
1217
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1218
|
+
_request_timeout: Union[
|
1219
|
+
None,
|
1220
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1221
|
+
Tuple[
|
1222
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1223
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1224
|
+
]
|
1225
|
+
] = None,
|
1226
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1227
|
+
_content_type: Optional[StrictStr] = None,
|
1228
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1229
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1230
|
+
) -> SearchResponse:
|
1231
|
+
"""This retrieves relevant documents in the dataset
|
1232
|
+
|
1233
|
+
|
1234
|
+
:param search_payload: (required)
|
1235
|
+
:type search_payload: SearchPayload
|
1236
|
+
:param q_answer_api_key:
|
1237
|
+
:type q_answer_api_key: str
|
1238
|
+
:param _request_timeout: timeout setting for this request. If one
|
1239
|
+
number provided, it will be total request
|
1240
|
+
timeout. It can also be a pair (tuple) of
|
1241
|
+
(connection, read) timeouts.
|
1242
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1243
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1244
|
+
request; this effectively ignores the
|
1245
|
+
authentication in the spec for a single request.
|
1246
|
+
:type _request_auth: dict, optional
|
1247
|
+
:param _content_type: force content-type for the request.
|
1248
|
+
:type _content_type: str, Optional
|
1249
|
+
:param _headers: set to override the headers for a single
|
1250
|
+
request; this effectively ignores the headers
|
1251
|
+
in the spec for a single request.
|
1252
|
+
:type _headers: dict, optional
|
1253
|
+
:param _host_index: set to override the host_index for a single
|
1254
|
+
request; this effectively ignores the host_index
|
1255
|
+
in the spec for a single request.
|
1256
|
+
:type _host_index: int, optional
|
1257
|
+
:return: Returns the result object.
|
1258
|
+
""" # noqa: E501
|
1259
|
+
|
1260
|
+
_param = self._search_on_dataset_serialize(
|
1261
|
+
search_payload=search_payload,
|
1262
|
+
q_answer_api_key=q_answer_api_key,
|
1263
|
+
_request_auth=_request_auth,
|
1264
|
+
_content_type=_content_type,
|
1265
|
+
_headers=_headers,
|
1266
|
+
_host_index=_host_index
|
1267
|
+
)
|
1268
|
+
|
1269
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1270
|
+
'200': "SearchResponse",
|
1271
|
+
}
|
1272
|
+
response_data = self.api_client.call_api(
|
1273
|
+
*_param,
|
1274
|
+
_request_timeout=_request_timeout
|
1275
|
+
)
|
1276
|
+
response_data.read()
|
1277
|
+
return self.api_client.response_deserialize(
|
1278
|
+
response_data=response_data,
|
1279
|
+
response_types_map=_response_types_map,
|
1280
|
+
).data
|
1281
|
+
|
1282
|
+
|
1283
|
+
@validate_call
|
1284
|
+
def search_on_dataset_with_http_info(
|
1285
|
+
self,
|
1286
|
+
search_payload: SearchPayload,
|
1287
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1288
|
+
_request_timeout: Union[
|
1289
|
+
None,
|
1290
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1291
|
+
Tuple[
|
1292
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1293
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1294
|
+
]
|
1295
|
+
] = None,
|
1296
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1297
|
+
_content_type: Optional[StrictStr] = None,
|
1298
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1299
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1300
|
+
) -> ApiResponse[SearchResponse]:
|
1301
|
+
"""This retrieves relevant documents in the dataset
|
1302
|
+
|
1303
|
+
|
1304
|
+
:param search_payload: (required)
|
1305
|
+
:type search_payload: SearchPayload
|
1306
|
+
:param q_answer_api_key:
|
1307
|
+
:type q_answer_api_key: str
|
1308
|
+
:param _request_timeout: timeout setting for this request. If one
|
1309
|
+
number provided, it will be total request
|
1310
|
+
timeout. It can also be a pair (tuple) of
|
1311
|
+
(connection, read) timeouts.
|
1312
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1313
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1314
|
+
request; this effectively ignores the
|
1315
|
+
authentication in the spec for a single request.
|
1316
|
+
:type _request_auth: dict, optional
|
1317
|
+
:param _content_type: force content-type for the request.
|
1318
|
+
:type _content_type: str, Optional
|
1319
|
+
:param _headers: set to override the headers for a single
|
1320
|
+
request; this effectively ignores the headers
|
1321
|
+
in the spec for a single request.
|
1322
|
+
:type _headers: dict, optional
|
1323
|
+
:param _host_index: set to override the host_index for a single
|
1324
|
+
request; this effectively ignores the host_index
|
1325
|
+
in the spec for a single request.
|
1326
|
+
:type _host_index: int, optional
|
1327
|
+
:return: Returns the result object.
|
1328
|
+
""" # noqa: E501
|
1329
|
+
|
1330
|
+
_param = self._search_on_dataset_serialize(
|
1331
|
+
search_payload=search_payload,
|
1332
|
+
q_answer_api_key=q_answer_api_key,
|
1333
|
+
_request_auth=_request_auth,
|
1334
|
+
_content_type=_content_type,
|
1335
|
+
_headers=_headers,
|
1336
|
+
_host_index=_host_index
|
1337
|
+
)
|
1338
|
+
|
1339
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1340
|
+
'200': "SearchResponse",
|
1341
|
+
}
|
1342
|
+
response_data = self.api_client.call_api(
|
1343
|
+
*_param,
|
1344
|
+
_request_timeout=_request_timeout
|
1345
|
+
)
|
1346
|
+
response_data.read()
|
1347
|
+
return self.api_client.response_deserialize(
|
1348
|
+
response_data=response_data,
|
1349
|
+
response_types_map=_response_types_map,
|
1350
|
+
)
|
1351
|
+
|
1352
|
+
|
1353
|
+
@validate_call
|
1354
|
+
def search_on_dataset_without_preload_content(
|
1355
|
+
self,
|
1356
|
+
search_payload: SearchPayload,
|
1357
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1358
|
+
_request_timeout: Union[
|
1359
|
+
None,
|
1360
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1361
|
+
Tuple[
|
1362
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1363
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1364
|
+
]
|
1365
|
+
] = None,
|
1366
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1367
|
+
_content_type: Optional[StrictStr] = None,
|
1368
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1369
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1370
|
+
) -> RESTResponseType:
|
1371
|
+
"""This retrieves relevant documents in the dataset
|
1372
|
+
|
1373
|
+
|
1374
|
+
:param search_payload: (required)
|
1375
|
+
:type search_payload: SearchPayload
|
1376
|
+
:param q_answer_api_key:
|
1377
|
+
:type q_answer_api_key: str
|
1378
|
+
:param _request_timeout: timeout setting for this request. If one
|
1379
|
+
number provided, it will be total request
|
1380
|
+
timeout. It can also be a pair (tuple) of
|
1381
|
+
(connection, read) timeouts.
|
1382
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1383
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1384
|
+
request; this effectively ignores the
|
1385
|
+
authentication in the spec for a single request.
|
1386
|
+
:type _request_auth: dict, optional
|
1387
|
+
:param _content_type: force content-type for the request.
|
1388
|
+
:type _content_type: str, Optional
|
1389
|
+
:param _headers: set to override the headers for a single
|
1390
|
+
request; this effectively ignores the headers
|
1391
|
+
in the spec for a single request.
|
1392
|
+
:type _headers: dict, optional
|
1393
|
+
:param _host_index: set to override the host_index for a single
|
1394
|
+
request; this effectively ignores the host_index
|
1395
|
+
in the spec for a single request.
|
1396
|
+
:type _host_index: int, optional
|
1397
|
+
:return: Returns the result object.
|
1398
|
+
""" # noqa: E501
|
1399
|
+
|
1400
|
+
_param = self._search_on_dataset_serialize(
|
1401
|
+
search_payload=search_payload,
|
1402
|
+
q_answer_api_key=q_answer_api_key,
|
1403
|
+
_request_auth=_request_auth,
|
1404
|
+
_content_type=_content_type,
|
1405
|
+
_headers=_headers,
|
1406
|
+
_host_index=_host_index
|
1407
|
+
)
|
1408
|
+
|
1409
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1410
|
+
'200': "SearchResponse",
|
1411
|
+
}
|
1412
|
+
response_data = self.api_client.call_api(
|
1413
|
+
*_param,
|
1414
|
+
_request_timeout=_request_timeout
|
1415
|
+
)
|
1416
|
+
return response_data.response
|
1417
|
+
|
1418
|
+
|
1419
|
+
def _search_on_dataset_serialize(
|
1420
|
+
self,
|
1421
|
+
search_payload,
|
1422
|
+
q_answer_api_key,
|
1423
|
+
_request_auth,
|
1424
|
+
_content_type,
|
1425
|
+
_headers,
|
1426
|
+
_host_index,
|
1427
|
+
) -> RequestSerialized:
|
1428
|
+
|
1429
|
+
_host = None
|
1430
|
+
|
1431
|
+
_collection_formats: Dict[str, str] = {
|
1432
|
+
}
|
1433
|
+
|
1434
|
+
_path_params: Dict[str, str] = {}
|
1435
|
+
_query_params: List[Tuple[str, str]] = []
|
1436
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1437
|
+
_form_params: List[Tuple[str, str]] = []
|
1438
|
+
_files: Dict[
|
1439
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1440
|
+
] = {}
|
1441
|
+
_body_params: Optional[bytes] = None
|
1442
|
+
|
1443
|
+
# process the path parameters
|
1444
|
+
# process the query parameters
|
1445
|
+
# process the header parameters
|
1446
|
+
if q_answer_api_key is not None:
|
1447
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
1448
|
+
# process the form parameters
|
1449
|
+
# process the body parameter
|
1450
|
+
if search_payload is not None:
|
1451
|
+
_body_params = search_payload
|
1452
|
+
|
1453
|
+
|
1454
|
+
# set the HTTP header `Accept`
|
1455
|
+
if 'Accept' not in _header_params:
|
1456
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1457
|
+
[
|
1458
|
+
'*/*'
|
1459
|
+
]
|
1460
|
+
)
|
1461
|
+
|
1462
|
+
# set the HTTP header `Content-Type`
|
1463
|
+
if _content_type:
|
1464
|
+
_header_params['Content-Type'] = _content_type
|
1465
|
+
else:
|
1466
|
+
_default_content_type = (
|
1467
|
+
self.api_client.select_header_content_type(
|
1468
|
+
[
|
1469
|
+
'application/json'
|
1470
|
+
]
|
1471
|
+
)
|
1472
|
+
)
|
1473
|
+
if _default_content_type is not None:
|
1474
|
+
_header_params['Content-Type'] = _default_content_type
|
1475
|
+
|
1476
|
+
# authentication setting
|
1477
|
+
_auth_settings: List[str] = [
|
1478
|
+
'QAnswer-Api-Key',
|
1479
|
+
'Bearer'
|
1480
|
+
]
|
1481
|
+
|
1482
|
+
return self.api_client.param_serialize(
|
1483
|
+
method='POST',
|
1484
|
+
resource_path='/api/tasks/search/retrieve',
|
1485
|
+
path_params=_path_params,
|
1486
|
+
query_params=_query_params,
|
1487
|
+
header_params=_header_params,
|
1488
|
+
body=_body_params,
|
1489
|
+
post_params=_form_params,
|
1490
|
+
files=_files,
|
1491
|
+
auth_settings=_auth_settings,
|
1492
|
+
collection_formats=_collection_formats,
|
1493
|
+
_host=_host,
|
1494
|
+
_request_auth=_request_auth
|
1495
|
+
)
|
1496
|
+
|
1497
|
+
|
1498
|
+
|
1499
|
+
|
1500
|
+
@validate_call
|
1501
|
+
def search_on_dataset_with_qa(
|
1502
|
+
self,
|
1503
|
+
rag_payload: RAGPayload,
|
1504
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1505
|
+
_request_timeout: Union[
|
1506
|
+
None,
|
1507
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1508
|
+
Tuple[
|
1509
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1510
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1511
|
+
]
|
1512
|
+
] = None,
|
1513
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1514
|
+
_content_type: Optional[StrictStr] = None,
|
1515
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1516
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1517
|
+
) -> RAGResponse:
|
1518
|
+
"""This generates a direct answer when searching over data
|
1519
|
+
|
1520
|
+
|
1521
|
+
:param rag_payload: (required)
|
1522
|
+
:type rag_payload: RAGPayload
|
1523
|
+
:param q_answer_api_key:
|
1524
|
+
:type q_answer_api_key: str
|
1525
|
+
:param _request_timeout: timeout setting for this request. If one
|
1526
|
+
number provided, it will be total request
|
1527
|
+
timeout. It can also be a pair (tuple) of
|
1528
|
+
(connection, read) timeouts.
|
1529
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1530
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1531
|
+
request; this effectively ignores the
|
1532
|
+
authentication in the spec for a single request.
|
1533
|
+
:type _request_auth: dict, optional
|
1534
|
+
:param _content_type: force content-type for the request.
|
1535
|
+
:type _content_type: str, Optional
|
1536
|
+
:param _headers: set to override the headers for a single
|
1537
|
+
request; this effectively ignores the headers
|
1538
|
+
in the spec for a single request.
|
1539
|
+
:type _headers: dict, optional
|
1540
|
+
:param _host_index: set to override the host_index for a single
|
1541
|
+
request; this effectively ignores the host_index
|
1542
|
+
in the spec for a single request.
|
1543
|
+
:type _host_index: int, optional
|
1544
|
+
:return: Returns the result object.
|
1545
|
+
""" # noqa: E501
|
1546
|
+
|
1547
|
+
_param = self._search_on_dataset_with_qa_serialize(
|
1548
|
+
rag_payload=rag_payload,
|
1549
|
+
q_answer_api_key=q_answer_api_key,
|
1550
|
+
_request_auth=_request_auth,
|
1551
|
+
_content_type=_content_type,
|
1552
|
+
_headers=_headers,
|
1553
|
+
_host_index=_host_index
|
1554
|
+
)
|
1555
|
+
|
1556
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1557
|
+
'200': "RAGResponse",
|
1558
|
+
}
|
1559
|
+
response_data = self.api_client.call_api(
|
1560
|
+
*_param,
|
1561
|
+
_request_timeout=_request_timeout
|
1562
|
+
)
|
1563
|
+
response_data.read()
|
1564
|
+
return self.api_client.response_deserialize(
|
1565
|
+
response_data=response_data,
|
1566
|
+
response_types_map=_response_types_map,
|
1567
|
+
).data
|
1568
|
+
|
1569
|
+
|
1570
|
+
@validate_call
|
1571
|
+
def search_on_dataset_with_qa_with_http_info(
|
1572
|
+
self,
|
1573
|
+
rag_payload: RAGPayload,
|
1574
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1575
|
+
_request_timeout: Union[
|
1576
|
+
None,
|
1577
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1578
|
+
Tuple[
|
1579
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1580
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1581
|
+
]
|
1582
|
+
] = None,
|
1583
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1584
|
+
_content_type: Optional[StrictStr] = None,
|
1585
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1586
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1587
|
+
) -> ApiResponse[RAGResponse]:
|
1588
|
+
"""This generates a direct answer when searching over data
|
1589
|
+
|
1590
|
+
|
1591
|
+
:param rag_payload: (required)
|
1592
|
+
:type rag_payload: RAGPayload
|
1593
|
+
:param q_answer_api_key:
|
1594
|
+
:type q_answer_api_key: str
|
1595
|
+
:param _request_timeout: timeout setting for this request. If one
|
1596
|
+
number provided, it will be total request
|
1597
|
+
timeout. It can also be a pair (tuple) of
|
1598
|
+
(connection, read) timeouts.
|
1599
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1600
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1601
|
+
request; this effectively ignores the
|
1602
|
+
authentication in the spec for a single request.
|
1603
|
+
:type _request_auth: dict, optional
|
1604
|
+
:param _content_type: force content-type for the request.
|
1605
|
+
:type _content_type: str, Optional
|
1606
|
+
:param _headers: set to override the headers for a single
|
1607
|
+
request; this effectively ignores the headers
|
1608
|
+
in the spec for a single request.
|
1609
|
+
:type _headers: dict, optional
|
1610
|
+
:param _host_index: set to override the host_index for a single
|
1611
|
+
request; this effectively ignores the host_index
|
1612
|
+
in the spec for a single request.
|
1613
|
+
:type _host_index: int, optional
|
1614
|
+
:return: Returns the result object.
|
1615
|
+
""" # noqa: E501
|
1616
|
+
|
1617
|
+
_param = self._search_on_dataset_with_qa_serialize(
|
1618
|
+
rag_payload=rag_payload,
|
1619
|
+
q_answer_api_key=q_answer_api_key,
|
1620
|
+
_request_auth=_request_auth,
|
1621
|
+
_content_type=_content_type,
|
1622
|
+
_headers=_headers,
|
1623
|
+
_host_index=_host_index
|
1624
|
+
)
|
1625
|
+
|
1626
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1627
|
+
'200': "RAGResponse",
|
1628
|
+
}
|
1629
|
+
response_data = self.api_client.call_api(
|
1630
|
+
*_param,
|
1631
|
+
_request_timeout=_request_timeout
|
1632
|
+
)
|
1633
|
+
response_data.read()
|
1634
|
+
return self.api_client.response_deserialize(
|
1635
|
+
response_data=response_data,
|
1636
|
+
response_types_map=_response_types_map,
|
1637
|
+
)
|
1638
|
+
|
1639
|
+
|
1640
|
+
@validate_call
|
1641
|
+
def search_on_dataset_with_qa_without_preload_content(
|
1642
|
+
self,
|
1643
|
+
rag_payload: RAGPayload,
|
1644
|
+
q_answer_api_key: Optional[StrictStr] = None,
|
1645
|
+
_request_timeout: Union[
|
1646
|
+
None,
|
1647
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1648
|
+
Tuple[
|
1649
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1650
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1651
|
+
]
|
1652
|
+
] = None,
|
1653
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1654
|
+
_content_type: Optional[StrictStr] = None,
|
1655
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1656
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1657
|
+
) -> RESTResponseType:
|
1658
|
+
"""This generates a direct answer when searching over data
|
1659
|
+
|
1660
|
+
|
1661
|
+
:param rag_payload: (required)
|
1662
|
+
:type rag_payload: RAGPayload
|
1663
|
+
:param q_answer_api_key:
|
1664
|
+
:type q_answer_api_key: str
|
1665
|
+
:param _request_timeout: timeout setting for this request. If one
|
1666
|
+
number provided, it will be total request
|
1667
|
+
timeout. It can also be a pair (tuple) of
|
1668
|
+
(connection, read) timeouts.
|
1669
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1670
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1671
|
+
request; this effectively ignores the
|
1672
|
+
authentication in the spec for a single request.
|
1673
|
+
:type _request_auth: dict, optional
|
1674
|
+
:param _content_type: force content-type for the request.
|
1675
|
+
:type _content_type: str, Optional
|
1676
|
+
:param _headers: set to override the headers for a single
|
1677
|
+
request; this effectively ignores the headers
|
1678
|
+
in the spec for a single request.
|
1679
|
+
:type _headers: dict, optional
|
1680
|
+
:param _host_index: set to override the host_index for a single
|
1681
|
+
request; this effectively ignores the host_index
|
1682
|
+
in the spec for a single request.
|
1683
|
+
:type _host_index: int, optional
|
1684
|
+
:return: Returns the result object.
|
1685
|
+
""" # noqa: E501
|
1686
|
+
|
1687
|
+
_param = self._search_on_dataset_with_qa_serialize(
|
1688
|
+
rag_payload=rag_payload,
|
1689
|
+
q_answer_api_key=q_answer_api_key,
|
1690
|
+
_request_auth=_request_auth,
|
1691
|
+
_content_type=_content_type,
|
1692
|
+
_headers=_headers,
|
1693
|
+
_host_index=_host_index
|
1694
|
+
)
|
1695
|
+
|
1696
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1697
|
+
'200': "RAGResponse",
|
1698
|
+
}
|
1699
|
+
response_data = self.api_client.call_api(
|
1700
|
+
*_param,
|
1701
|
+
_request_timeout=_request_timeout
|
1702
|
+
)
|
1703
|
+
return response_data.response
|
1704
|
+
|
1705
|
+
|
1706
|
+
def _search_on_dataset_with_qa_serialize(
|
1707
|
+
self,
|
1708
|
+
rag_payload,
|
1709
|
+
q_answer_api_key,
|
1710
|
+
_request_auth,
|
1711
|
+
_content_type,
|
1712
|
+
_headers,
|
1713
|
+
_host_index,
|
1714
|
+
) -> RequestSerialized:
|
1715
|
+
|
1716
|
+
_host = None
|
1717
|
+
|
1718
|
+
_collection_formats: Dict[str, str] = {
|
1719
|
+
}
|
1720
|
+
|
1721
|
+
_path_params: Dict[str, str] = {}
|
1722
|
+
_query_params: List[Tuple[str, str]] = []
|
1723
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1724
|
+
_form_params: List[Tuple[str, str]] = []
|
1725
|
+
_files: Dict[
|
1726
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
1727
|
+
] = {}
|
1728
|
+
_body_params: Optional[bytes] = None
|
1729
|
+
|
1730
|
+
# process the path parameters
|
1731
|
+
# process the query parameters
|
1732
|
+
# process the header parameters
|
1733
|
+
if q_answer_api_key is not None:
|
1734
|
+
_header_params['QAnswer-Api-Key'] = q_answer_api_key
|
1735
|
+
# process the form parameters
|
1736
|
+
# process the body parameter
|
1737
|
+
if rag_payload is not None:
|
1738
|
+
_body_params = rag_payload
|
1739
|
+
|
1740
|
+
|
1741
|
+
# set the HTTP header `Accept`
|
1742
|
+
if 'Accept' not in _header_params:
|
1743
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
1744
|
+
[
|
1745
|
+
'*/*'
|
1746
|
+
]
|
1747
|
+
)
|
1748
|
+
|
1749
|
+
# set the HTTP header `Content-Type`
|
1750
|
+
if _content_type:
|
1751
|
+
_header_params['Content-Type'] = _content_type
|
1752
|
+
else:
|
1753
|
+
_default_content_type = (
|
1754
|
+
self.api_client.select_header_content_type(
|
1755
|
+
[
|
1756
|
+
'application/json'
|
1757
|
+
]
|
1758
|
+
)
|
1759
|
+
)
|
1760
|
+
if _default_content_type is not None:
|
1761
|
+
_header_params['Content-Type'] = _default_content_type
|
1762
|
+
|
1763
|
+
# authentication setting
|
1764
|
+
_auth_settings: List[str] = [
|
1765
|
+
'QAnswer-Api-Key',
|
1766
|
+
'Bearer'
|
1767
|
+
]
|
1768
|
+
|
1769
|
+
return self.api_client.param_serialize(
|
1770
|
+
method='POST',
|
1771
|
+
resource_path='/api/tasks/search/generate',
|
1772
|
+
path_params=_path_params,
|
1773
|
+
query_params=_query_params,
|
1774
|
+
header_params=_header_params,
|
1775
|
+
body=_body_params,
|
1776
|
+
post_params=_form_params,
|
1777
|
+
files=_files,
|
1778
|
+
auth_settings=_auth_settings,
|
1779
|
+
collection_formats=_collection_formats,
|
1780
|
+
_host=_host,
|
1781
|
+
_request_auth=_request_auth
|
1782
|
+
)
|
1783
|
+
|
1784
|
+
|