From bf0beda7dcdefa5bd0baf41bea1c31872bd2ace3 Mon Sep 17 00:00:00 2001 From: cthomas Date: Mon, 26 May 2025 14:09:13 -0700 Subject: [PATCH] feat(asyncify): migrate patch tool (#2440) --- letta/server/rest_api/routers/v1/tools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/letta/server/rest_api/routers/v1/tools.py b/letta/server/rest_api/routers/v1/tools.py index 591cc003..f58df428 100644 --- a/letta/server/rest_api/routers/v1/tools.py +++ b/letta/server/rest_api/routers/v1/tools.py @@ -158,7 +158,7 @@ async def upsert_tool( @router.patch("/{tool_id}", response_model=Tool, operation_id="modify_tool") -def modify_tool( +async def modify_tool( tool_id: str, request: ToolUpdate = Body(...), server: SyncServer = Depends(get_letta_server), @@ -168,8 +168,8 @@ def modify_tool( Update an existing tool """ try: - actor = server.user_manager.get_user_or_default(user_id=actor_id) - return server.tool_manager.update_tool_by_id(tool_id=tool_id, tool_update=request, actor=actor) + actor = await server.user_manager.get_actor_or_default_async(actor_id=actor_id) + return await server.tool_manager.update_tool_by_id_async(tool_id=tool_id, tool_update=request, actor=actor) except LettaToolCreateError as e: # HTTP 400 == Bad Request print(f"Error occurred during tool update: {e}")