Files
dify/api/fields/document_fields.py
T
+40 5bbf685035 feat: fix i18n missing keys and merge upstream/main (#24615)
Signed-off-by: -LAN- <[email protected]>
Signed-off-by: kenwoodjw <[email protected]>
Signed-off-by: Yongtao Huang <[email protected]>
Signed-off-by: yihong0618 <[email protected]>
Signed-off-by: zhanluxianshen <[email protected]>
Co-authored-by: -LAN- <[email protected]>
Co-authored-by: GuanMu <[email protected]>
Co-authored-by: Davide Delbianco <[email protected]>
Co-authored-by: NeatGuyCoding <[email protected]>
Co-authored-by: kenwoodjw <[email protected]>
Co-authored-by: Yongtao Huang <[email protected]>
Co-authored-by: Yongtao Huang <[email protected]>
Co-authored-by: Qiang Lee <[email protected]>
Co-authored-by: 李强04 <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Asuka Minato <[email protected]>
Co-authored-by: Matri Qi <[email protected]>
Co-authored-by: huayaoyue6 <[email protected]>
Co-authored-by: Bowen Liang <[email protected]>
Co-authored-by: znn <[email protected]>
Co-authored-by: crazywoola <[email protected]>
Co-authored-by: crazywoola <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: yihong <[email protected]>
Co-authored-by: Muke Wang <[email protected]>
Co-authored-by: wangmuke <[email protected]>
Co-authored-by: Wu Tianwei <[email protected]>
Co-authored-by: quicksand <[email protected]>
Co-authored-by: 非法操作 <[email protected]>
Co-authored-by: zxhlyh <[email protected]>
Co-authored-by: Eric Guo <[email protected]>
Co-authored-by: Zhedong Cen <[email protected]>
Co-authored-by: jiangbo721 <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: hjlarry <[email protected]>
Co-authored-by: lxsummer <[email protected]>
Co-authored-by: 湛露先生 <[email protected]>
Co-authored-by: Guangdong Liu <[email protected]>
Co-authored-by: QuantumGhost <[email protected]>
Co-authored-by: Claude <[email protected]>
Co-authored-by: Yessenia-d <[email protected]>
Co-authored-by: huangzhuo1949 <[email protected]>
Co-authored-by: huangzhuo <[email protected]>
Co-authored-by: 17hz <[email protected]>
Co-authored-by: Amy <[email protected]>
Co-authored-by: Joel <[email protected]>
Co-authored-by: Nite Knite <[email protected]>
Co-authored-by: Yeuoly <[email protected]>
Co-authored-by: Petrus Han <[email protected]>
Co-authored-by: iamjoel <[email protected]>
Co-authored-by: Kalo Chin <[email protected]>
Co-authored-by: Ujjwal Maurya <[email protected]>
Co-authored-by: Maries <[email protected]>
2025-08-27 15:07:28 +08:00

87 lines
2.9 KiB
Python

from flask_restx import fields
from fields.dataset_fields import dataset_fields
from libs.helper import TimestampField
document_metadata_fields = {
"id": fields.String,
"name": fields.String,
"type": fields.String,
"value": fields.String,
}
document_fields = {
"id": fields.String,
"position": fields.Integer,
"data_source_type": fields.String,
"data_source_info": fields.Raw(attribute="data_source_info_dict"),
"data_source_detail_dict": fields.Raw(attribute="data_source_detail_dict"),
"dataset_process_rule_id": fields.String,
"name": fields.String,
"created_from": fields.String,
"created_by": fields.String,
"created_at": TimestampField,
"tokens": fields.Integer,
"indexing_status": fields.String,
"error": fields.String,
"enabled": fields.Boolean,
"disabled_at": TimestampField,
"disabled_by": fields.String,
"archived": fields.Boolean,
"display_status": fields.String,
"word_count": fields.Integer,
"hit_count": fields.Integer,
"doc_form": fields.String,
"doc_metadata": fields.List(fields.Nested(document_metadata_fields), attribute="doc_metadata_details"),
}
document_with_segments_fields = {
"id": fields.String,
"position": fields.Integer,
"data_source_type": fields.String,
"data_source_info": fields.Raw(attribute="data_source_info_dict"),
"data_source_detail_dict": fields.Raw(attribute="data_source_detail_dict"),
"dataset_process_rule_id": fields.String,
"process_rule_dict": fields.Raw(attribute="process_rule_dict"),
"name": fields.String,
"created_from": fields.String,
"created_by": fields.String,
"created_at": TimestampField,
"tokens": fields.Integer,
"indexing_status": fields.String,
"error": fields.String,
"enabled": fields.Boolean,
"disabled_at": TimestampField,
"disabled_by": fields.String,
"archived": fields.Boolean,
"display_status": fields.String,
"word_count": fields.Integer,
"hit_count": fields.Integer,
"completed_segments": fields.Integer,
"total_segments": fields.Integer,
"doc_metadata": fields.List(fields.Nested(document_metadata_fields), attribute="doc_metadata_details"),
}
dataset_and_document_fields = {
"dataset": fields.Nested(dataset_fields),
"documents": fields.List(fields.Nested(document_fields)),
"batch": fields.String,
}
document_status_fields = {
"id": fields.String,
"indexing_status": fields.String,
"processing_started_at": TimestampField,
"parsing_completed_at": TimestampField,
"cleaning_completed_at": TimestampField,
"splitting_completed_at": TimestampField,
"completed_at": TimestampField,
"paused_at": TimestampField,
"error": fields.String,
"stopped_at": TimestampField,
"completed_segments": fields.Integer,
"total_segments": fields.Integer,
}
document_status_fields_list = {"data": fields.List(fields.Nested(document_status_fields))}