From 6f57ae50bd94258ccd82a2a2f978da4b1e4df34e Mon Sep 17 00:00:00 2001 From: genekogan Date: Sun, 5 Jan 2025 12:57:53 -0800 Subject: [PATCH] id to _id --- eve/api.py | 2 +- eve/tools/comfyui_tool.py | 1 - tests/test_client.py | 7 ++++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/eve/api.py b/eve/api.py index 9784ef2..a06002b 100644 --- a/eve/api.py +++ b/eve/api.py @@ -142,7 +142,7 @@ async def task_admin( _: dict = Depends(auth.authenticate_admin) ): result = await handle_task(request.tool, request.user_id, request.args) - return serialize_document(result.model_dump()) + return serialize_document(result.model_dump(by_alias=True)) async def handle_cancel(task_id: str, user_id: str): diff --git a/eve/tools/comfyui_tool.py b/eve/tools/comfyui_tool.py index dc4a42f..d3433c5 100644 --- a/eve/tools/comfyui_tool.py +++ b/eve/tools/comfyui_tool.py @@ -50,7 +50,6 @@ async def async_run(self, args: Dict): async def async_start_task(self, task: Task): db = os.getenv("DB") cls = modal.Cls.lookup( - # f"comfyui-{self.workspace}-{task.db}", f"comfyui-{self.workspace}-{db}", "ComfyUI", environment_name="main" diff --git a/tests/test_client.py b/tests/test_client.py index 467bc07..4d9b8ff 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -21,9 +21,11 @@ def run_create(server_url): } } response = requests.post(server_url+"/create", json=request, headers=headers) + print("GO!!!") print(response) print("Status Code:", response.status_code) print(json.dumps(response.json(), indent=2)) + print("done...") def run_chat(server_url): @@ -58,7 +60,7 @@ def test_client(): run_create(server_url) print("\nRunning chat test...") - run_chat(server_url) + # run_chat(server_url) except KeyboardInterrupt: print("\nShutting down...") @@ -69,3 +71,6 @@ def test_client(): server.terminate() server.wait() + +if __name__ == "__main__": + test_client() \ No newline at end of file