Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/toolbox-core/src/toolbox_core/sync_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
"""
Expand Down