2024-04-28 06:35:51 +00:00
|
|
|
|
# coding=utf-8
|
|
|
|
|
|
"""
|
|
|
|
|
|
@project: maxkb
|
|
|
|
|
|
@Author:虎
|
|
|
|
|
|
@file: document_api.py
|
|
|
|
|
|
@date:2024/4/28 13:56
|
|
|
|
|
|
@desc:
|
|
|
|
|
|
"""
|
|
|
|
|
|
from drf_yasg import openapi
|
|
|
|
|
|
|
|
|
|
|
|
from common.mixins.api_mixin import ApiMixin
|
2025-01-13 08:38:28 +00:00
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
2024-04-28 06:35:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DocumentApi(ApiMixin):
|
|
|
|
|
|
class BatchEditHitHandlingApi(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request_body_api():
|
|
|
|
|
|
return openapi.Schema(
|
|
|
|
|
|
type=openapi.TYPE_OBJECT,
|
|
|
|
|
|
properties={
|
|
|
|
|
|
'id_list': openapi.Schema(type=openapi.TYPE_ARRAY, items=openapi.Schema(type=openapi.TYPE_STRING),
|
2025-01-13 08:38:28 +00:00
|
|
|
|
title=_('id list'),
|
|
|
|
|
|
description=_('id list')),
|
|
|
|
|
|
'hit_handling_method': openapi.Schema(type=openapi.TYPE_STRING, title=_('hit handling method'),
|
2024-05-08 09:31:56 +00:00
|
|
|
|
description="directly_return|optimization"),
|
2025-01-13 08:38:28 +00:00
|
|
|
|
'directly_return_similarity': openapi.Schema(type=openapi.TYPE_NUMBER, title=_('directly return similarity'))
|
2024-04-28 06:35:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
)
|
2024-11-26 04:08:13 +00:00
|
|
|
|
|
|
|
|
|
|
class Cancel(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request_body_api():
|
|
|
|
|
|
return openapi.Schema(
|
|
|
|
|
|
type=openapi.TYPE_OBJECT,
|
|
|
|
|
|
properties={
|
2025-01-13 08:38:28 +00:00
|
|
|
|
'type': openapi.Schema(type=openapi.TYPE_INTEGER, title=_('task type'),
|
|
|
|
|
|
description=_('1|2|3 1:Vectorization|2:Generate issues|3:Synchronize documents'))
|
2024-11-26 04:08:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
)
|
2024-12-24 09:09:27 +00:00
|
|
|
|
|
|
|
|
|
|
class BatchCancel(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request_body_api():
|
|
|
|
|
|
return openapi.Schema(
|
|
|
|
|
|
type=openapi.TYPE_OBJECT,
|
|
|
|
|
|
properties={
|
|
|
|
|
|
'id_list': openapi.Schema(type=openapi.TYPE_ARRAY, items=openapi.Schema(type=openapi.TYPE_STRING),
|
2025-01-13 08:38:28 +00:00
|
|
|
|
title=_('id list'),
|
|
|
|
|
|
description=_('id list')),
|
|
|
|
|
|
'type': openapi.Schema(type=openapi.TYPE_INTEGER, title=_('task type'),
|
|
|
|
|
|
description=_('1|2|3 1:Vectorization|2:Generate issues|3:Synchronize documents'), default=1)
|
2024-12-24 09:09:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
)
|
2025-01-07 03:15:10 +00:00
|
|
|
|
|
|
|
|
|
|
class EmbeddingState(ApiMixin):
|
|
|
|
|
|
@staticmethod
|
|
|
|
|
|
def get_request_body_api():
|
|
|
|
|
|
return openapi.Schema(
|
|
|
|
|
|
type=openapi.TYPE_OBJECT,
|
|
|
|
|
|
properties={
|
|
|
|
|
|
'state_list': openapi.Schema(type=openapi.TYPE_ARRAY,
|
|
|
|
|
|
items=openapi.Schema(type=openapi.TYPE_STRING),
|
2025-01-13 08:38:28 +00:00
|
|
|
|
title=_('state list'),
|
|
|
|
|
|
description=_('state list'))
|
2025-01-07 03:15:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
)
|