MCPcopy
hub / github.com/1Panel-dev/MaxKB / re_open_chat

Method re_open_chat

apps/chat/serializers/chat.py:481–495  ·  view source on GitHub ↗
(self, chat_id: str)

Source from the content-addressed store, hash-verified

479 return chat_info
480
481 def re_open_chat(self, chat_id: str):
482 chat = QuerySet(Chat).filter(id=chat_id).first()
483 if chat is None:
484 raise ChatException(500, _("Conversation does not exist"))
485 application = QuerySet(Application).filter(id=chat.application_id).first()
486 if application is None:
487 raise ChatException(500, _("Application does not exist"))
488 application_version = QuerySet(ApplicationVersion).filter(application_id=application.id).order_by(
489 '-create_time')[0:1].first()
490 if application_version is None:
491 raise ChatException(500, _("The application has not been published. Please use it after publishing."))
492 if application.type == ApplicationTypeChoices.SIMPLE:
493 return self.re_open_chat_simple(chat_id, application)
494 else:
495 return self.re_open_chat_work_flow(chat_id, application)
496
497 def re_open_chat_simple(self, chat_id, application):
498 # 数据集id列表

Callers 2

generate_chatMethod · 0.95
get_chat_infoMethod · 0.95

Calls 3

re_open_chat_simpleMethod · 0.95
ChatExceptionClass · 0.90

Tested by

no test coverage detected