mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-02 19:27:48 +08:00
7753ba2d37
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Yeuoly <admin@srmxy.cn> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: jyong <jyong@dify.ai> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: jyong <718720800@qq.com>
31 lines
847 B
Python
31 lines
847 B
Python
from flask_restful import fields
|
|
|
|
from libs.helper import TimestampField
|
|
|
|
annotation_fields = {
|
|
"id": fields.String,
|
|
"question": fields.String,
|
|
"answer": fields.Raw(attribute='content'),
|
|
"hit_count": fields.Integer,
|
|
"created_at": TimestampField,
|
|
# 'account': fields.Nested(simple_account_fields, allow_null=True)
|
|
}
|
|
|
|
annotation_list_fields = {
|
|
"data": fields.List(fields.Nested(annotation_fields)),
|
|
}
|
|
|
|
annotation_hit_history_fields = {
|
|
"id": fields.String,
|
|
"source": fields.String,
|
|
"score": fields.Float,
|
|
"question": fields.String,
|
|
"created_at": TimestampField,
|
|
"match": fields.String(attribute='annotation_question'),
|
|
"response": fields.String(attribute='annotation_content')
|
|
}
|
|
|
|
annotation_hit_history_list_fields = {
|
|
"data": fields.List(fields.Nested(annotation_hit_history_fields)),
|
|
}
|