Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/dataset/serializers/document_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@ def get_request_params_api():
required=True,
description='知识库id'),
]
@staticmethod
def get_request_body_api():
return openapi.Schema(
type=openapi.TYPE_OBJECT,
required=['source_url_list'],
properties={
'source_url_list': openapi.Schema(type=openapi.TYPE_ARRAY, title="文档地址列表", description="文档地址列表",
items=openapi.Schema(type=openapi.TYPE_STRING)),
'selector': openapi.Schema(type=openapi.TYPE_STRING, title="选择器", description="选择器")
}
)



class DocumentInstanceSerializer(ApiMixin, serializers.Serializer):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码主要是关于一个类ApiMixin(其中还包含另一个名为DocumentInstanceSerializer的序列化器)和几个方法 get_request_params_api, document_instance_id_and_name, 和 doc_title.

为了提供具体反馈,需要您给出具体的差异或问题。

例如:

  • 是否存在不必要的空行?
  • 定位是否存在Python语法错误(比如缺少分号等)
  • API请求参数描述中有没有错别字?
  • 类名是否遵循约定命名规则?

请提供更多细节以便于给出更准确的回复。

Expand Down
Loading