refactor: update cache service type hints in MCPToolsComponent (#8975)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-07-10 08:52:25 -03:00 committed by GitHub
commit d325fca054
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)