From 3455354944819d0898bab86bb1c90253d48a5e27 Mon Sep 17 00:00:00 2001 From: Kye Date: Mon, 10 Jul 2023 09:49:55 -0400 Subject: [PATCH] clean up Former-commit-id: 5db20d63b3cbd3f4e12636061d265b313bddf06e --- api/worker.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/api/worker.py b/api/worker.py index e36bc95d..df63d83b 100644 --- a/api/worker.py +++ b/api/worker.py @@ -1,15 +1,14 @@ import os + from celery import Celery from celery.result import AsyncResult -from api.container import swarms - -celery_broker = os.getenv("CELERY_BROKER_URL", "") +from api.container import agent_manager celery_app = Celery(__name__) -celery_app.conf.broker_url = celery_broker -celery_app.conf.result_backend = celery_broker +celery_app.conf.broker_url = os.environ["CELERY_BROKER_URL"] +celery_app.conf.result_backend = os.environ["CELERY_BROKER_URL"] celery_app.conf.update( task_track_started=True, task_serializer="json", @@ -21,7 +20,7 @@ celery_app.conf.update( @celery_app.task(name="task_execute", bind=True) def task_execute(self, session: str, prompt: str): - executor = swarms.create_executor(session, self) + executor = agent_manager.create_executor(session, self) response = executor({"input": prompt}) result = {"output": response["output"]} @@ -42,4 +41,4 @@ def start_worker(): "worker", "--loglevel=INFO", ] - ) + ) \ No newline at end of file