Skip to content

feat: /conversations api response add 'update_at' field,and update api docs add sort_by parameter #10043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions api/fields/conversation_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def format(self, value):
"from_account_name": fields.String,
"read_at": TimestampField,
"created_at": TimestampField,
"updated_at": TimestampField,
"annotation": fields.Nested(annotation_fields, allow_null=True),
"model_config": fields.Nested(simple_model_config_fields),
"user_feedback_stats": fields.Nested(feedback_stat_fields),
Expand Down Expand Up @@ -182,6 +183,7 @@ def format(self, value):
"from_end_user_id": fields.String,
"from_account_id": fields.String,
"created_at": TimestampField,
"updated_at": TimestampField,
"annotated": fields.Boolean,
"introduction": fields.String,
"model_config": fields.Nested(model_config_fields),
Expand All @@ -197,6 +199,7 @@ def format(self, value):
"status": fields.String,
"introduction": fields.String,
"created_at": TimestampField,
"updated_at": TimestampField,
}

conversation_infinite_scroll_pagination_fields = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,11 @@ Chat applications support session persistence, allowing previous chat history to
<Property name='pinned' type='bool' key='pinned'>
Return only pinned conversations as `true`, only non-pinned as `false`
</Property>
<Property name='sort_by' type='string' key='sort_by'>
Sorting Field (Optional), Default: -updated_at (sorted in descending order by update time)
- Available Values: created_at, -created_at, updated_at, -updated_at
- The symbol before the field represents the order or reverse, "-" represents reverse order.
</Property>
</Properties>

### Response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
<Property name='pinned' type='bool' key='pinned'>
只返回置顶 true,只返回非置顶 false
</Property>
<Property name='sort_by' type='string' key='sort_by'>
排序字段(选题),默认 -updated_at(按更新时间倒序排列)
- 可选值:created_at, -created_at, updated_at, -updated_at
- 字段前面的符号代表顺序或倒序,-代表倒序
</Property>
</Properties>

### Response
Expand Down
5 changes: 5 additions & 0 deletions web/app/components/develop/template/template_chat.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,11 @@ Chat applications support session persistence, allowing previous chat history to
<Property name='pinned' type='bool' key='pinned'>
Return only pinned conversations as `true`, only non-pinned as `false`
</Property>
<Property name='sort_by' type='string' key='sort_by'>
Sorting Field (Optional), Default: -updated_at (sorted in descending order by update time)
- Available Values: created_at, -created_at, updated_at, -updated_at
- The symbol before the field represents the order or reverse, "-" represents reverse order.
</Property>
</Properties>

### Response
Expand Down
5 changes: 5 additions & 0 deletions web/app/components/develop/template/template_chat.zh.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty } from '../md.tsx'
<Property name='pinned' type='bool' key='pinned'>
只返回置顶 true,只返回非置顶 false
</Property>
<Property name='sort_by' type='string' key='sort_by'>
排序字段(选题),默认 -updated_at(按更新时间倒序排列)
- 可选值:created_at, -created_at, updated_at, -updated_at
- 字段前面的符号代表顺序或倒序,-代表倒序
</Property>
</Properties>

### Response
Expand Down