diff --git a/packages/toolbox-core/src/toolbox_core/sync_tool.py b/packages/toolbox-core/src/toolbox_core/sync_tool.py index ad24e8e3..6e3179ed 100644 --- a/packages/toolbox-core/src/toolbox_core/sync_tool.py +++ b/packages/toolbox-core/src/toolbox_core/sync_tool.py @@ -16,6 +16,7 @@ from asyncio import AbstractEventLoop from inspect import Signature from threading import Thread +from types import MappingProxyType from typing import Any, Callable, Mapping, TypeVar, Union from .tool import ToolboxTool @@ -81,11 +82,11 @@ def __signature__(self) -> Signature: return self.__async_tool.__signature__ @property - def __annotations__(self) -> dict[str, Any]: # type: ignore[override] + def __annotations__(self) -> MappingProxyType[str, Any]: # type: ignore[override] # Standard Python object attributes like __doc__ are technically "writable". # But not defining a setter function makes this a read-only property. # Mypy flags this issue in the type checks. - return self.__async_tool.__annotations__ + return MappingProxyType(self.__async_tool.__annotations__) def __call__(self, *args: Any, **kwargs: Any) -> str: """