|
|
|
|
@ -46,7 +46,9 @@ class CompletionConversationApi(Resource):
|
|
|
|
|
parser.add_argument("limit", type=int_range(1, 100), default=20, location="args")
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
query = db.select(Conversation).where(Conversation.app_id == app_model.id, Conversation.mode == "completion")
|
|
|
|
|
query = db.select(Conversation).where(
|
|
|
|
|
Conversation.is_deleted == False, Conversation.app_id == app_model.id, Conversation.mode == "completion"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if args["keyword"]:
|
|
|
|
|
query = query.join(Message, Message.conversation_id == Conversation.id).filter(
|
|
|
|
|
@ -171,7 +173,7 @@ class ChatConversationApi(Resource):
|
|
|
|
|
.subquery()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
query = db.select(Conversation).where(Conversation.app_id == app_model.id)
|
|
|
|
|
query = db.select(Conversation).where(Conversation.app_id == app_model.id, Conversation.is_deleted == False)
|
|
|
|
|
|
|
|
|
|
if args["keyword"]:
|
|
|
|
|
keyword_filter = "%{}%".format(args["keyword"])
|
|
|
|
|
|