|
28 | 28 | from application.serializers.application_serializers import ModelDatasetAssociation, DatasetSettingSerializer, \ |
29 | 29 | ModelSettingSerializer |
30 | 30 | from application.serializers.chat_message_serializers import ChatInfo |
31 | | -from common.config.embedding_config import ModelManage |
32 | 31 | from common.constants.permission_constants import RoleConstants |
33 | 32 | from common.db.search import native_search, native_page_search, page_search, get_dynamics_model |
34 | 33 | from common.event import ListenerManagement |
|
40 | 39 | from dataset.models import Document, Problem, Paragraph, ProblemParagraphMapping |
41 | 40 | from dataset.serializers.common_serializers import get_embedding_model_by_dataset_id |
42 | 41 | from dataset.serializers.paragraph_serializers import ParagraphSerializers |
43 | | -from setting.models import Model |
44 | | -from setting.models_provider import get_model |
45 | 42 | from smartdoc.conf import PROJECT_DIR |
46 | 43 |
|
47 | 44 | chat_cache = caches['chat_cache'] |
@@ -312,7 +309,8 @@ def open(self): |
312 | 309 | chat_id = str(uuid.uuid1()) |
313 | 310 | model_id = self.data.get('model_id') |
314 | 311 | dataset_id_list = self.data.get('dataset_id_list') |
315 | | - application = Application(id=None, dialogue_number=3, model_id=model_id, |
| 312 | + dialogue_number = 3 if self.data.get('multiple_rounds_dialogue', False) else 0 |
| 313 | + application = Application(id=None, dialogue_number=dialogue_number, model_id=model_id, |
316 | 314 | dataset_setting=self.data.get('dataset_setting'), |
317 | 315 | model_setting=self.data.get('model_setting'), |
318 | 316 | problem_optimization=self.data.get('problem_optimization'), |
|
0 commit comments