From a3f26519c388b2156e1c50c614e6fe8a69a37b77 Mon Sep 17 00:00:00 2001 From: Matthew Zhou Date: Sun, 3 Nov 2024 11:42:01 -0800 Subject: [PATCH] chore: Tweak composio log levels (#1976) --- letta/schemas/tool.py | 3 ++- letta/services/tool_manager.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/letta/schemas/tool.py b/letta/schemas/tool.py index effbd792..e7277aa6 100644 --- a/letta/schemas/tool.py +++ b/letta/schemas/tool.py @@ -1,5 +1,6 @@ from typing import Dict, List, Optional +from composio import LogLevel from pydantic import Field from letta.functions.helpers import ( @@ -84,7 +85,7 @@ class ToolCreate(LettaBase): """ from composio_langchain import ComposioToolSet - composio_toolset = ComposioToolSet() + composio_toolset = ComposioToolSet(logging_level=LogLevel.ERROR) composio_tools = composio_toolset.get_tools(actions=[action]) assert len(composio_tools) > 0, "User supplied parameters do not match any Composio tools" diff --git a/letta/services/tool_manager.py b/letta/services/tool_manager.py index 7658464c..cee451df 100644 --- a/letta/services/tool_manager.py +++ b/letta/services/tool_manager.py @@ -12,7 +12,7 @@ from letta.orm.tool import Tool as ToolModel from letta.schemas.tool import Tool as PydanticTool from letta.schemas.tool import ToolCreate, ToolUpdate from letta.schemas.user import User as PydanticUser -from letta.utils import enforce_types +from letta.utils import enforce_types, printd class ToolManager: @@ -54,7 +54,7 @@ class ToolManager: if update_data: self.update_tool_by_id(tool.id, ToolUpdate(**update_data), actor) else: - warnings.warn( + printd( f"`create_or_update_tool` was called with user_id={actor.id}, organization_id={actor.organization_id}, name={tool_create.name}, but found existing tool with nothing to update." ) except NoResultFound: