diff --git a/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py b/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py index 1817ba56a..9e09e8a8e 100644 --- a/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py +++ b/apps/application/flow/step_node/image_understand_step_node/impl/base_image_understand_node.py @@ -115,7 +115,11 @@ class BaseImageUnderstandNode(IImageUnderstandNode): image_list = data['image_list'] if len(image_list) == 0 or data['dialogue_type'] == 'WORKFLOW': return HumanMessage(content=chat_record.problem_text) - return HumanMessage(content=data['question']) + file_id = image_list[0]['file_id'] + return HumanMessage(content=[ + {'type': 'text', 'text': data['question']}, + {'type': 'image_url', 'image_url': {'url': f'/api/file/{file_id}'}}, + ]) return HumanMessage(content=chat_record.problem_text) def get_history_message(self, history_chat_record, dialogue_number): diff --git a/apps/application/template/embed.js b/apps/application/template/embed.js index e3d9f1862..f05cf1c1d 100644 --- a/apps/application/template/embed.js +++ b/apps/application/template/embed.js @@ -165,7 +165,7 @@ function initMaxkbStyle(root){ #maxkb .maxkb-mask .maxkb-content { width: 64px; height: 64px; - box-shadow: 1px 1px 1px 2000px rgba(0,0,0,.6); + box-shadow: 1px 1px 1px 9999px rgba(0,0,0,.6); position: absolute; {{x_type}}: {{x_value}}px; {{y_type}}: {{y_value}}px; @@ -244,6 +244,7 @@ function initMaxkbStyle(root){ cursor: pointer; max-height:500px; max-width:500px; + z-index:10000; } #maxkb #maxkb-chat-container{ z-index:10000;position: relative; diff --git a/apps/common/job/clean_chat_job.py b/apps/common/job/clean_chat_job.py index d42c39982..347f1a8a8 100644 --- a/apps/common/job/clean_chat_job.py +++ b/apps/common/job/clean_chat_job.py @@ -39,11 +39,12 @@ def clean_chat_log_job(): with transaction.atomic(): logs_to_delete = Chat.objects.filter(query_conditions).values_list('id', flat=True)[:batch_size] count = logs_to_delete.count() + logs_to_delete_str = [str(uuid) for uuid in logs_to_delete] if count == 0: break deleted_count, _ = Chat.objects.filter(id__in=logs_to_delete).delete() # 删除对应的文件 - File.objects.filter(meta__chat_id__in=[str(uuid) for uuid in logs_to_delete]).delete() + File.objects.filter(meta__chat_id__in=logs_to_delete_str).delete() if deleted_count < batch_size: break @@ -57,6 +58,6 @@ def run(): existing_job = scheduler.get_job(job_id='clean_chat_log') if existing_job is not None: existing_job.remove() - scheduler.add_job(clean_chat_log_job, 'cron', hour='0', minute='5', id='clean_chat_log') + scheduler.add_job(clean_chat_log_job, 'cron', hour='0', minute='5', id='clean_chat_log') finally: lock.un_lock('clean_chat_log_job') diff --git a/apps/embedding/task/embedding.py b/apps/embedding/task/embedding.py index 3e63c26b2..7087636c2 100644 --- a/apps/embedding/task/embedding.py +++ b/apps/embedding/task/embedding.py @@ -17,7 +17,7 @@ from django.db.models import QuerySet from common.config.embedding_config import ModelManage from common.event import ListenerManagement, UpdateProblemArgs, UpdateEmbeddingDatasetIdArgs, \ UpdateEmbeddingDocumentIdArgs -from dataset.models import Document, Status +from dataset.models import Document, Status, TaskType, State from ops import celery_app from setting.models import Model from setting.models_provider import get_model @@ -66,8 +66,8 @@ def embedding_by_document(document_id, model_id): """ def exception_handler(e): - QuerySet(Document).filter(id=document_id).update( - **{'status': Status.error, 'update_time': datetime.datetime.now()}) + ListenerManagement.update_status(QuerySet(Document).filter(id=document_id), TaskType.EMBEDDING, + State.FAILURE) max_kb_error.error( f'获取向量模型失败:{str(e)}{traceback.format_exc()}') @@ -102,7 +102,6 @@ def embedding_by_dataset(dataset_id, model_id): max_kb.info(f"数据集文档:{[d.name for d in document_list]}") for document in document_list: try: - print(document.id, model_id) embedding_by_document.delay(document.id, model_id) except Exception as e: pass diff --git a/ui/src/components/ai-chat/ExecutionDetailDialog.vue b/ui/src/components/ai-chat/ExecutionDetailDialog.vue index 70bd3f78f..641d7eca9 100644 --- a/ui/src/components/ai-chat/ExecutionDetailDialog.vue +++ b/ui/src/components/ai-chat/ExecutionDetailDialog.vue @@ -410,7 +410,6 @@
本次对话
-

图片: