diff --git a/src/google/adk/tools/base_authenticated_tool.py b/src/google/adk/tools/base_authenticated_tool.py index 862d1cef..92e395d4 100644 --- a/src/google/adk/tools/base_authenticated_tool.py +++ b/src/google/adk/tools/base_authenticated_tool.py @@ -66,6 +66,7 @@ class BaseAuthenticatedTool(BaseTool): name=name, description=description, ) + self._auth_config = auth_config if auth_config and auth_config.auth_scheme: self._credentials_manager = CredentialManager(auth_config=auth_config) diff --git a/tests/unittests/tools/test_base_authenticated_tool.py b/tests/unittests/tools/test_base_authenticated_tool.py index 55454224..5f7bf53f 100644 --- a/tests/unittests/tools/test_base_authenticated_tool.py +++ b/tests/unittests/tools/test_base_authenticated_tool.py @@ -90,6 +90,7 @@ class TestBaseAuthenticatedTool: assert tool.description == "Test description" assert tool._credentials_manager is not None assert tool._response_for_auth_required == unauthenticated_response + assert tool._auth_config == auth_config def test_init_with_no_auth_config(self): """Test initialization without auth_config.""" @@ -99,6 +100,7 @@ class TestBaseAuthenticatedTool: assert tool.description == "Test authenticated tool" assert tool._credentials_manager is None assert tool._response_for_auth_required is None + assert tool._auth_config is None def test_init_with_empty_auth_scheme(self): """Test initialization with auth_config but no auth_scheme."""