Skip to content

Commit c293ace

Browse files
rchlziamjoel
authored andcommitted
feat: /conversations api response add 'update_at' field,and update api docs add sort_by parameter (#10043)
1 parent 4d5752f commit c293ace

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

api/fields/conversation_fields.py

+3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def format(self, value):
121121
"from_account_name": fields.String,
122122
"read_at": TimestampField,
123123
"created_at": TimestampField,
124+
"updated_at": TimestampField,
124125
"annotation": fields.Nested(annotation_fields, allow_null=True),
125126
"model_config": fields.Nested(simple_model_config_fields),
126127
"user_feedback_stats": fields.Nested(feedback_stat_fields),
@@ -182,6 +183,7 @@ def format(self, value):
182183
"from_end_user_id": fields.String,
183184
"from_account_id": fields.String,
184185
"created_at": TimestampField,
186+
"updated_at": TimestampField,
185187
"annotated": fields.Boolean,
186188
"introduction": fields.String,
187189
"model_config": fields.Nested(model_config_fields),
@@ -197,6 +199,7 @@ def format(self, value):
197199
"status": fields.String,
198200
"introduction": fields.String,
199201
"created_at": TimestampField,
202+
"updated_at": TimestampField,
200203
}
201204

202205
conversation_infinite_scroll_pagination_fields = {

web/app/components/develop/template/template_advanced_chat.en.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,11 @@ Chat applications support session persistence, allowing previous chat history to
656656
<Property name='pinned' type='bool' key='pinned'>
657657
Return only pinned conversations as `true`, only non-pinned as `false`
658658
</Property>
659+
<Property name='sort_by' type='string' key='sort_by'>
660+
Sorting Field (Optional), Default: -updated_at (sorted in descending order by update time)
661+
- Available Values: created_at, -created_at, updated_at, -updated_at
662+
- The symbol before the field represents the order or reverse, "-" represents reverse order.
663+
</Property>
659664
</Properties>
660665

661666
### Response

web/app/components/develop/template/template_advanced_chat.zh.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
691691
<Property name='pinned' type='bool' key='pinned'>
692692
只返回置顶 true,只返回非置顶 false
693693
</Property>
694+
<Property name='sort_by' type='string' key='sort_by'>
695+
排序字段(选题),默认 -updated_at(按更新时间倒序排列)
696+
- 可选值:created_at, -created_at, updated_at, -updated_at
697+
- 字段前面的符号代表顺序或倒序,-代表倒序
698+
</Property>
694699
</Properties>
695700

696701
### Response

web/app/components/develop/template/template_chat.en.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,11 @@ Chat applications support session persistence, allowing previous chat history to
690690
<Property name='pinned' type='bool' key='pinned'>
691691
Return only pinned conversations as `true`, only non-pinned as `false`
692692
</Property>
693+
<Property name='sort_by' type='string' key='sort_by'>
694+
Sorting Field (Optional), Default: -updated_at (sorted in descending order by update time)
695+
- Available Values: created_at, -created_at, updated_at, -updated_at
696+
- The symbol before the field represents the order or reverse, "-" represents reverse order.
697+
</Property>
693698
</Properties>
694699

695700
### Response

web/app/components/develop/template/template_chat.zh.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
705705
<Property name='pinned' type='bool' key='pinned'>
706706
只返回置顶 true,只返回非置顶 false
707707
</Property>
708+
<Property name='sort_by' type='string' key='sort_by'>
709+
排序字段(选题),默认 -updated_at(按更新时间倒序排列)
710+
- 可选值:created_at, -created_at, updated_at, -updated_at
711+
- 字段前面的符号代表顺序或倒序,-代表倒序
712+
</Property>
708713
</Properties>
709714

710715
### Response

0 commit comments

Comments
 (0)