Skip to content

Commit 8619dca

Browse files
committed
refactor(tools): improve type hinting for credentials
Uses TYPE_CHECKING import to reference toolset_adk.CredentialConfig for the credentials parameter, improving static analysis without adding runtime dependencies.
1 parent 60d4ffd commit 8619dca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/google/adk/tools/toolbox_toolset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from typing import List
2020
from typing import Mapping
2121
from typing import Optional
22+
from typing import TYPE_CHECKING
2223
from typing import Union
2324

2425
from typing_extensions import override
@@ -27,6 +28,9 @@
2728
from .base_tool import BaseTool
2829
from .base_toolset import BaseToolset
2930

31+
if TYPE_CHECKING:
32+
from toolbox_adk import CredentialConfig
33+
3034

3135
class ToolboxToolset(BaseToolset):
3236
"""A class that provides access to toolbox toolsets.
@@ -55,7 +59,7 @@ def __init__(
5559
bound_params: Optional[
5660
Mapping[str, Union[Callable[[], Any], Any]]
5761
] = None,
58-
credentials: Optional[Any] = None,
62+
credentials: Optional[CredentialConfig] = None,
5963
additional_headers: Optional[Mapping[str, str]] = None,
6064
**kwargs,
6165
):

0 commit comments

Comments
 (0)