diff --git a/src/google/adk/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.py b/src/google/adk/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.py index cdce222..71e760e 100644 --- a/src/google/adk/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.py +++ b/src/google/adk/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.py @@ -185,7 +185,7 @@ class ToolAuthHandler: ) self.credential_store.store_credential(key, auth_credential) - def _reqeust_credential(self) -> None: + def _request_credential(self) -> None: """Handles the case where an OpenID Connect or OAuth2 authentication request is needed.""" if self.auth_scheme.type_ in ( AuthSchemeType.openIdConnect, @@ -223,11 +223,6 @@ class ToolAuthHandler: ) ) - def _request_credential(self, auth_config: AuthConfig): - if not self.tool_context: - return - self.tool_context.request_credential(auth_config) - def prepare_auth_credentials( self, ) -> AuthPreparationResult: @@ -260,7 +255,7 @@ class ToolAuthHandler: auth_credential=exchanged_credential, ) else: - self._reqeust_credential() + self._request_credential() return AuthPreparationResult( state="pending", auth_scheme=self.auth_scheme, diff --git a/tests/unittests/flows/llm_flows/test_functions_request_euc.py b/tests/unittests/flows/llm_flows/test_functions_request_euc.py index 3f5abca..3d5fcae 100644 --- a/tests/unittests/flows/llm_flows/test_functions_request_euc.py +++ b/tests/unittests/flows/llm_flows/test_functions_request_euc.py @@ -136,13 +136,13 @@ def test_function_request_euc(): function_call_ids = list(events[2].actions.requested_auth_configs.keys()) for idx, part in enumerate(events[1].content.parts): - reqeust_euc_function_call = part.function_call - assert reqeust_euc_function_call is not None + request_euc_function_call = part.function_call + assert request_euc_function_call is not None assert ( - reqeust_euc_function_call.name + request_euc_function_call.name == functions.REQUEST_EUC_FUNCTION_CALL_NAME ) - args = AuthToolArguments.model_validate(reqeust_euc_function_call.args) + args = AuthToolArguments.model_validate(request_euc_function_call.args) assert args.function_call_id == function_call_ids[idx] args.auth_config.auth_scheme.model_extra.clear() @@ -336,8 +336,8 @@ def test_function_get_auth_response(): ) assert function_invoked == 4 - reqeust = mock_model.requests[-1] - content = reqeust.contents[-1] + request = mock_model.requests[-1] + content = request.contents[-1] parts = content.parts assert len(parts) == 2 assert parts[0].function_response.name == 'call_external_api1' diff --git a/tests/unittests/flows/llm_flows/test_functions_simple.py b/tests/unittests/flows/llm_flows/test_functions_simple.py index 7ddb124..2c5ef9b 100644 --- a/tests/unittests/flows/llm_flows/test_functions_simple.py +++ b/tests/unittests/flows/llm_flows/test_functions_simple.py @@ -247,8 +247,8 @@ def test_function_call_id(): agent = Agent(name='root_agent', model=mock_model, tools=[increase_by_one]) runner = testing_utils.InMemoryRunner(agent) events = runner.run('test') - for reqeust in mock_model.requests: - for content in reqeust.contents: + for request in mock_model.requests: + for content in request.contents: for part in content.parts: if part.function_call: assert part.function_call.id is None