MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / open_simple

Method open_simple

apps/chat/serializers/chat.py:580–600  ·  view source on GitHub ↗
(self, application)

Source from the content-addressed store, hash-verified

578 return chat_id
579
580 def open_simple(self, application):
581 application_id = self.data.get('application_id')
582 chat_user_id = self.data.get("chat_user_id")
583 chat_user_type = self.data.get("chat_user_type")
584 ip_address = self.data.get("ip_address")
585 source = self.data.get("source")
586 debug = self.data.get("debug")
587 knowledge_id_list = [str(row.target_id) for row in
588 QuerySet(ResourceMapping).filter(source_id=str(application_id),
589 source_type='APPLICATION',
590 target_type='KNOWLEDGE')]
591
592 chat_id = str(uuid.uuid7())
593 ChatInfo(chat_id, chat_user_id, chat_user_type, ip_address, source, knowledge_id_list,
594 [str(document.id) for document in
595 QuerySet(Document).filter(
596 knowledge_id__in=knowledge_id_list,
597 is_active=False)],
598 application_id,
599 debug=debug).set_cache()
600 return chat_id
601
602
603class TextToSpeechSerializers(serializers.Serializer):

Callers 1

openMethod · 0.95

Calls 3

ChatInfoClass · 0.90
set_cacheMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected