mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 12:37:20 +08:00
fix: remove chat conversation api dead arg message_count_gte (#29097)
This commit is contained in:
parent
3e5f683e90
commit
5bb715ee2f
@ -49,7 +49,6 @@ class CompletionConversationQuery(BaseConversationQuery):
|
|||||||
|
|
||||||
|
|
||||||
class ChatConversationQuery(BaseConversationQuery):
|
class ChatConversationQuery(BaseConversationQuery):
|
||||||
message_count_gte: int | None = Field(default=None, ge=1, description="Minimum message count")
|
|
||||||
sort_by: Literal["created_at", "-created_at", "updated_at", "-updated_at"] = Field(
|
sort_by: Literal["created_at", "-created_at", "updated_at", "-updated_at"] = Field(
|
||||||
default="-updated_at", description="Sort field and direction"
|
default="-updated_at", description="Sort field and direction"
|
||||||
)
|
)
|
||||||
@ -509,14 +508,6 @@ class ChatConversationApi(Resource):
|
|||||||
.having(func.count(MessageAnnotation.id) == 0)
|
.having(func.count(MessageAnnotation.id) == 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
if args.message_count_gte and args.message_count_gte >= 1:
|
|
||||||
query = (
|
|
||||||
query.options(joinedload(Conversation.messages)) # type: ignore
|
|
||||||
.join(Message, Message.conversation_id == Conversation.id)
|
|
||||||
.group_by(Conversation.id)
|
|
||||||
.having(func.count(Message.id) >= args.message_count_gte)
|
|
||||||
)
|
|
||||||
|
|
||||||
if app_model.mode == AppMode.ADVANCED_CHAT:
|
if app_model.mode == AppMode.ADVANCED_CHAT:
|
||||||
query = query.where(Conversation.invoke_from != InvokeFrom.DEBUGGER)
|
query = query.where(Conversation.invoke_from != InvokeFrom.DEBUGGER)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user