| 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														from flask_login import current_user | 
														 | 
														 | 
														from flask_login import current_user | 
													
													
												
													
														 | 
														 | 
														from flask_restful import Resource, marshal, marshal_with, reqparse | 
														 | 
														 | 
														from flask_restful import Resource, marshal, marshal_with, reqparse | 
													
													
												
													
														 | 
														 | 
														from libs.login import login_required | 
														 | 
														 | 
														from libs.login import login_required | 
													
													
												
													
														 | 
														 | 
														from models.dataset import Document, DocumentSegment | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														from models.dataset import Dataset, Document, DocumentSegment | 
													
													
												
													
														 | 
														 | 
														from models.model import ApiToken, UploadFile | 
														 | 
														 | 
														from models.model import ApiToken, UploadFile | 
													
													
												
													
														 | 
														 | 
														from services.dataset_service import DatasetService, DocumentService | 
														 | 
														 | 
														from services.dataset_service import DatasetService, DocumentService | 
													
													
												
													
														 | 
														 | 
														from werkzeug.exceptions import Forbidden, NotFound | 
														 | 
														 | 
														from werkzeug.exceptions import Forbidden, NotFound | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														                            help='type is required. Name must be between 1 to 40 characters.', | 
														 | 
														 | 
														                            help='type is required. Name must be between 1 to 40 characters.', | 
													
													
												
													
														 | 
														 | 
														                            type=_validate_name) | 
														 | 
														 | 
														                            type=_validate_name) | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('indexing_technique', type=str, location='json', | 
														 | 
														 | 
														        parser.add_argument('indexing_technique', type=str, location='json', | 
													
													
												
													
														 | 
														 | 
														                            choices=('high_quality', 'economy'), | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                            choices=Dataset.INDEXING_TECHNIQUE_LIST, | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                            nullable=True, | 
													
													
												
													
														 | 
														 | 
														                            help='Invalid indexing technique.') | 
														 | 
														 | 
														                            help='Invalid indexing technique.') | 
													
													
												
													
														 | 
														 | 
														        args = parser.parse_args() | 
														 | 
														 | 
														        args = parser.parse_args() | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														                            location='json', store_missing=False, | 
														 | 
														 | 
														                            location='json', store_missing=False, | 
													
													
												
													
														 | 
														 | 
														                            type=_validate_description_length) | 
														 | 
														 | 
														                            type=_validate_description_length) | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('indexing_technique', type=str, location='json', | 
														 | 
														 | 
														        parser.add_argument('indexing_technique', type=str, location='json', | 
													
													
												
													
														 | 
														 | 
														                            choices=('high_quality', 'economy'), | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														                            help='Invalid indexing technique.') | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                    choices=Dataset.INDEXING_TECHNIQUE_LIST, | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                    nullable=True, | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                    help='Invalid indexing technique.') | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('permission', type=str, location='json', choices=( | 
														 | 
														 | 
														        parser.add_argument('permission', type=str, location='json', choices=( | 
													
													
												
													
														 | 
														 | 
														            'only_me', 'all_team_members'), help='Invalid permission.') | 
														 | 
														 | 
														            'only_me', 'all_team_members'), help='Invalid permission.') | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('retrieval_model', type=dict, location='json', help='Invalid retrieval model.') | 
														 | 
														 | 
														        parser.add_argument('retrieval_model', type=dict, location='json', help='Invalid retrieval model.') | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        parser = reqparse.RequestParser() | 
														 | 
														 | 
														        parser = reqparse.RequestParser() | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('info_list', type=dict, required=True, nullable=True, location='json') | 
														 | 
														 | 
														        parser.add_argument('info_list', type=dict, required=True, nullable=True, location='json') | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('process_rule', type=dict, required=True, nullable=True, location='json') | 
														 | 
														 | 
														        parser.add_argument('process_rule', type=dict, required=True, nullable=True, location='json') | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('indexing_technique', type=str, required=True, nullable=True, location='json') | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														        parser.add_argument('indexing_technique', type=str, required=True,  | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                            choices=Dataset.INDEXING_TECHNIQUE_LIST, | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														                            nullable=True, location='json') | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('doc_form', type=str, default='text_model', required=False, nullable=False, location='json') | 
														 | 
														 | 
														        parser.add_argument('doc_form', type=str, default='text_model', required=False, nullable=False, location='json') | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('dataset_id', type=str, required=False, nullable=False, location='json') | 
														 | 
														 | 
														        parser.add_argument('dataset_id', type=str, required=False, nullable=False, location='json') | 
													
													
												
													
														 | 
														 | 
														        parser.add_argument('doc_language', type=str, default='English', required=False, nullable=False, | 
														 | 
														 | 
														        parser.add_argument('doc_language', type=str, default='English', required=False, nullable=False, |