From d325fca054250f8843aa1acd8222a360b8d19400 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 10 Jul 2025 08:52:25 -0300 Subject: [PATCH] refactor: update cache service type hints in MCPToolsComponent (#8975) --- .../base/langflow/components/agents/mcp_component.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/base/langflow/components/agents/mcp_component.py b/src/backend/base/langflow/components/agents/mcp_component.py index 056fff5e1..93b561081 100644 --- a/src/backend/base/langflow/components/agents/mcp_component.py +++ b/src/backend/base/langflow/components/agents/mcp_component.py @@ -29,7 +29,7 @@ if TYPE_CHECKING: from langchain_core.tools import StructuredTool from langflow.inputs.inputs import InputTypes - from langflow.services.shared_component_cache.service import SharedComponentCacheService + from langflow.services.cache.base import CacheService def maybe_unflatten_dict(flat: dict[str, Any]) -> dict[str, Any]: @@ -70,7 +70,7 @@ def maybe_unflatten_dict(flat: dict[str, Any]) -> dict[str, Any]: return nested -def safe_cache_get(cache: SharedComponentCacheService, key, default=None): +def safe_cache_get(cache: CacheService, key, default=None): """Safely get a value from cache, handling CacheMiss objects.""" try: value = cache.get(key) @@ -82,7 +82,7 @@ def safe_cache_get(cache: SharedComponentCacheService, key, default=None): return value -def safe_cache_set(cache: SharedComponentCacheService, key, value): +def safe_cache_set(cache: CacheService, key, value): """Safely set a value in cache, handling potential errors.""" try: cache.set(key, value)