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

Method get_chat_info

apps/chat/serializers/chat.py:472–479  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

470 return self.chat_work_flow(chat_info, instance, base_to_response)
471
472 def get_chat_info(self):
473 self.is_valid(raise_exception=True)
474 chat_id = self.data.get('chat_id')
475 chat_info: ChatInfo = ChatInfo.get_cache(chat_id)
476 if chat_info is None:
477 chat_info: ChatInfo = self.re_open_chat(chat_id)
478 chat_info.set_cache()
479 return chat_info
480
481 def re_open_chat(self, chat_id: str):
482 chat = QuerySet(Chat).filter(id=chat_id).first()

Callers 1

chatMethod · 0.95

Calls 5

re_open_chatMethod · 0.95
get_cacheMethod · 0.80
set_cacheMethod · 0.80
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected