diff --git a/docker-compose.yaml b/docker-compose.yaml index 70b4c97..e8cd0f9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -85,11 +85,11 @@ services: command: redis-server --requirepass ${REDIS_PASSWORD} celery_worker: - image: cr.yandex/crpc50gkvq2bp251sfgb/backend + image: cr.yandex/crpc50vq2bp251sfgb/backend build: context: ./services/backend - dockerfile: Dockerfile - command: celery -A celery_worker.celery worker --loglevel=info + dockerfile: Dockerfile-celery + entrypoint: watchmedo auto-restart --directory=./ --pattern=*.py --recursive -- celery -A celery_worker.celery worker --loglevel=info volumes: - ./services/backend:/app environment: @@ -100,7 +100,7 @@ services: depends_on: - db - redis - - backend_app + - ml ml: restart: unless-stopped diff --git a/services/backend/services/rag_service.py b/services/backend/services/rag_service.py index addaa9e..d96ecba 100644 --- a/services/backend/services/rag_service.py +++ b/services/backend/services/rag_service.py @@ -52,7 +52,7 @@ def on_success(self, retval, task_id, args, kwargs): message = MessageService.from_task_id(task_id).model MessageService.save_message( - SaveMessageOptions(text=retval['result'], task_id=task_id, conversation_id=message.conversation_id, role=Role.SYSTEM, file_id = retval['file_id']) + SaveMessageOptions(text=retval['output']['result'], task_id=task_id, conversation_id=message.conversation_id, role=Role.SYSTEM, file_id = retval['file_id']) ) super().on_success(retval, task_id, args, kwargs) @@ -92,9 +92,11 @@ def run_question_task(question: str): def run_file_question_task(file_id, file_path, question: str) -> dict: try: result = { + "output":{ "result": f'Ответ на вопрос с файлом: {question}', "file_id": file_id, "file_path": file_path + } } json.dumps(result)