chore: internal changes

Co-authored-by: George Weale <gweale@google.com>
PiperOrigin-RevId: 929293376
This commit is contained in:
George Weale
2026-06-09 11:02:19 -07:00
committed by Copybara-Service
parent 1ff015848c
commit 020683bb7b
11 changed files with 28 additions and 25 deletions
+1 -1
View File
@@ -1490,7 +1490,7 @@ def cli_generate_eval_cases(
click.echo("Generating scenarios utilizing Vertex AI Eval SDK...")
scenarios = generator.generate_scenarios(root_agent, config)
# TODO(pthodoroff): Expose initial session state when simulation library
# TODO: Expose initial session state when simulation library
# supports it.
initial_session_state = create_empty_state(root_agent)
@@ -149,7 +149,7 @@ def _raise_for_any_of_if_mldev(schema: types.Schema):
def _update_for_default_if_mldev(schema: types.Schema):
if schema.default is not None:
# TODO(kech): Remove this workaround once mldev supports default value.
# TODO: Remove this workaround once mldev supports default value.
schema.default = None
logger.warning(
'Default value is not supported in function declaration schema for'
@@ -42,7 +42,7 @@ from .integration_connector_tool import IntegrationConnectorTool
logger = logging.getLogger("google_adk." + __name__)
# TODO(cheliu): Apply a common toolset interface
# TODO: Apply a common toolset interface
class ApplicationIntegrationToolset(BaseToolset):
"""ApplicationIntegrationToolset generates tools from a given Application
Integration or Integration Connector resource.
+1 -1
View File
@@ -297,7 +297,7 @@ You could retry calling this tool, but it is IMPORTANT for you to provide all th
else:
return target(**args_to_call)
# TODO(hangfei): fix call live for function stream.
# TODO: fix call live for function stream.
async def _call_live(
self,
*,
@@ -364,7 +364,7 @@ def credential_to_param(
kwargs = {param.py_name: auth_credential.api_key}
return param, kwargs
# TODO(cheliu): Split handling for OpenIDConnect scheme and native HTTPBearer
# TODO: Split handling for OpenIDConnect scheme and native HTTPBearer
# Scheme
elif (
auth_credential and auth_credential.auth_type == AuthCredentialTypes.HTTP
@@ -103,7 +103,7 @@ class OAuth2CredentialExchanger(BaseAuthCredentialExchanger):
Raises:
ValueError: If the auth scheme or auth credential is invalid.
"""
# TODO(cheliu): Implement token refresh flow
# TODO: Implement token refresh flow
self._check_scheme_credential_type(auth_scheme, auth_credential)
@@ -244,7 +244,7 @@ class PydocHelper:
content = response_details.content or {}
# Generate return type hint and properties for the first response type.
# TODO(cheliu): Handle multiple content types.
# TODO: Handle multiple content types.
for _, schema_details in content.items():
schema = schema_details.schema_ or {}
@@ -4,15 +4,12 @@ Verifies OAuth flows using GCP Agent Identity Credentials service.
## Setup
To set up your environment for the first time, run the `uv` setup script:
```bash
cd open_source_workspace
./uv_setup.sh
```
Then, activate the virtual environment:
To set up your environment for the first time, create a virtual environment
and install dependencies:
```bash
uv venv --python "python3.11" ".venv"
source .venv/bin/activate
uv sync --all-extras
```
Then, install test specific packages
@@ -170,8 +170,10 @@ def test_vertex_ai_session_service_fails_on_creation():
def test_vertexai_dependency_shim_raises_clear_importerror():
"""Verify that the Vertex AI dependency shim points users to the dependency."""
module_path = _REPO_ROOT / "dependencies_internal/vertexai.py"
if not module_path.is_file():
pytest.skip("Vertex AI dependency shim is not present in this build.")
with mock.patch.dict("sys.modules", {"google.cloud.aiplatform": None}):
module_path = _REPO_ROOT / "dependencies_internal/vertexai.py"
spec = importlib.util.spec_from_file_location(
"_test_google_adk_dependencies_vertexai", module_path
)
+13 -9
View File
@@ -41,19 +41,23 @@ import pytest
def _find_pyproject() -> Path:
"""Locates pyproject.toml by walking up from this file's directory.
Works in both layouts:
* Open-source: pyproject.toml lives at the repo root.
* google3: pyproject.toml lives under open_source_workspace/ and tests/ is
a symlink into the package root, so .resolve() lands in the wrong place.
Handles layouts where pyproject.toml is at an ancestor directory as well as
layouts where it lives in a sibling build directory next to the package. The
test tree may be symlinked, so the walk avoids ``.resolve()``.
"""
start = Path(__file__).parent
for candidate in [start, *start.parents]:
direct = candidate / 'pyproject.toml'
if direct.is_file():
return direct
sibling = candidate / 'open_source_workspace' / 'pyproject.toml'
if sibling.is_file():
return sibling
try:
children = sorted(p for p in candidate.iterdir() if p.is_dir())
except OSError:
continue
for child in children:
sibling = child / 'pyproject.toml'
if sibling.is_file():
return sibling
raise FileNotFoundError(
f'Could not find pyproject.toml walking up from {start}.'
)
@@ -105,8 +109,8 @@ def test_environment_simulation_config_imports_validation_error_from_pydantic()
pydantic-core is undeclared; importing from it directly is fragile. pydantic
re-exports ValidationError, so use that.
"""
# Use importlib to locate the source file so the test works in both the
# open-source layout (src/google/adk/...) and inside google3 (flat layout).
# Use importlib to locate the source file so the test is independent of the
# on-disk package layout.
spec = importlib.util.find_spec(
'google.adk.tools.environment_simulation.environment_simulation_config'
)
+1 -1
View File
@@ -374,7 +374,7 @@ async def test_update_artifacts():
'env_variables',
[
'GOOGLE_AI',
# TODO(wanyif): re-enable after fix.
# TODO: re-enable after fix.
# 'VERTEX',
],
indirect=True,