mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-13 15:14:50 -06:00
chore: Fix reqeust -> request typo
Copybara import of the project: -- 6beac4451fef1774365e75ab67779253c5ac79be by Calvin Giles <calvin.giles@trademe.co.nz>: chore: Fix reqeust -> request typo #non-breaking COPYBARA_INTEGRATE_REVIEW=https://github.com/google/adk-python/pull/883 from calvingiles:fix-reqeust-typo cfe592e6ad4ebc79bd2b3ebcd0370f868b57ff10 PiperOrigin-RevId: 765354040
This commit is contained in:
parent
ba5b80d5d7
commit
4075290a1d
@ -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,
|
||||
|
@ -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'
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user