| 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 | |
| 603 | class TextToSpeechSerializers(serializers.Serializer): |