You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hit_testing.py 754B

123456789101112131415161718
  1. from controllers.console.datasets.hit_testing_base import DatasetsHitTestingBase
  2. from controllers.service_api import api
  3. from controllers.service_api.wraps import DatasetApiResource, cloud_edition_billing_rate_limit_check
  4. class HitTestingApi(DatasetApiResource, DatasetsHitTestingBase):
  5. @cloud_edition_billing_rate_limit_check("knowledge", "dataset")
  6. def post(self, tenant_id, dataset_id):
  7. dataset_id_str = str(dataset_id)
  8. dataset = self.get_and_validate_dataset(dataset_id_str)
  9. args = self.parse_args()
  10. self.hit_testing_args_check(args)
  11. return self.perform_hit_testing(dataset, args)
  12. api.add_resource(HitTestingApi, "/datasets/<uuid:dataset_id>/hit-testing", "/datasets/<uuid:dataset_id>/retrieve")