Skip to content

Commit 72e7abf

Browse files
Merge branch 'main' into feat/firestore
2 parents ca724d2 + abcf14c commit 72e7abf

10 files changed

Lines changed: 84 additions & 21 deletions

File tree

src/google/adk/cli/cli_create.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,27 @@ def _handle_login_with_google() -> (
378378
f"Express Mode project created: {project_id}",
379379
fg="green",
380380
)
381+
current_proj = _get_gcp_project_from_gcloud()
382+
if current_proj and current_proj != project_id:
383+
click.secho(
384+
"Warning: Your default gcloud project is set to"
385+
f" '{current_proj}'. This might conflict with or override your"
386+
f" Express Mode project '{project_id}'. We recommend"
387+
" unsetting it.",
388+
fg="yellow",
389+
)
390+
if click.confirm("Run 'gcloud config unset project'?", default=True):
391+
try:
392+
subprocess.run(
393+
["gcloud", "config", "unset", "project"],
394+
check=True,
395+
capture_output=True,
396+
)
397+
click.secho("Unset default gcloud project.", fg="green")
398+
except Exception:
399+
click.secho(
400+
"Failed to unset project. Please do it manually.", fg="red"
401+
)
381402
return api_key, project_id, region
382403

383404
click.secho(_NOT_ELIGIBLE_MSG, fg="red")

src/google/adk/features/_feature_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ class FeatureConfig:
9999
FeatureStage.EXPERIMENTAL, default_on=True
100100
),
101101
FeatureName.BIG_QUERY_TOOLSET: FeatureConfig(
102-
FeatureStage.EXPERIMENTAL, default_on=True
102+
FeatureStage.STABLE, default_on=True
103103
),
104104
FeatureName.BIG_QUERY_TOOL_CONFIG: FeatureConfig(
105-
FeatureStage.EXPERIMENTAL, default_on=True
105+
FeatureStage.STABLE, default_on=True
106106
),
107107
FeatureName.BIGTABLE_TOOL_SETTINGS: FeatureConfig(
108108
FeatureStage.EXPERIMENTAL, default_on=True

src/google/adk/models/gemma_llm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ class GemmaFunctionCallModel(BaseModel):
163163
class Gemma(GemmaFunctionCallingMixin, Gemini):
164164
"""Integration for Gemma models exposed via the Gemini API.
165165
166-
Only Gemma 3 models are supported at this time. For agentic use cases,
167-
use of gemma-3-27b-it and gemma-3-12b-it are strongly recommended.
166+
For agentic use cases, use of gemma-3-27b-it, gemma-3-12b-it, and
167+
gemma-4-31b-it are strongly recommended.
168168
169169
For full documentation, see: https://ai.google.dev/gemma/docs/core/
170170
@@ -205,7 +205,7 @@ def supported_models(cls) -> list[str]:
205205
"""
206206

207207
return [
208-
r'gemma-3.*',
208+
r'gemma-.*',
209209
]
210210

211211
@cached_property

src/google/adk/tools/bigquery/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""BigQuery Tools (Experimental).
15+
"""BigQuery Tools.
1616
1717
BigQuery Tools under this module are hand crafted and customized while the tools
1818
under google.adk.tools.google_api_tool are auto generated based on API

src/google/adk/tools/bigquery/bigquery_credentials.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from __future__ import annotations
1616

17-
from ...features import experimental
1817
from ...features import FeatureName
1918
from .._google_credentials import BaseGoogleCredentialsConfig
2019

@@ -26,9 +25,8 @@
2625
BIGQUERY_DEFAULT_SCOPE = ["https://www.googleapis.com/auth/bigquery"]
2726

2827

29-
@experimental(FeatureName.GOOGLE_CREDENTIALS_CONFIG)
3028
class BigQueryCredentialsConfig(BaseGoogleCredentialsConfig):
31-
"""BigQuery Credentials Configuration for Google API tools (Experimental).
29+
"""BigQuery Credentials Configuration for Google API tools.
3230
3331
Please do not use this in production, as it may be deprecated later.
3432
"""

src/google/adk/tools/bigquery/bigquery_toolset.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from . import metadata_tool
2626
from . import query_tool
2727
from . import search_tool
28-
from ...features import experimental
2928
from ...features import FeatureName
3029
from ...tools.base_tool import BaseTool
3130
from ...tools.base_toolset import BaseToolset
@@ -35,7 +34,6 @@
3534
from .config import BigQueryToolConfig
3635

3736

38-
@experimental(FeatureName.BIG_QUERY_TOOLSET)
3937
class BigQueryToolset(BaseToolset):
4038
"""BigQuery Toolset contains tools for interacting with BigQuery data and metadata."""
4139

src/google/adk/tools/bigquery/config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from pydantic import ConfigDict
2222
from pydantic import field_validator
2323

24-
from ...features import experimental
2524
from ...features import FeatureName
2625

2726

@@ -48,7 +47,6 @@ class WriteMode(Enum):
4847
"""All write operations are allowed."""
4948

5049

51-
@experimental(FeatureName.BIG_QUERY_TOOL_CONFIG)
5250
class BigQueryToolConfig(BaseModel):
5351
"""Configuration for BigQuery tools."""
5452

tests/unittests/cli/utils/test_cli_create.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,52 @@ def test_handle_login_with_google_option_2(
417417
assert region == "us-central1"
418418

419419

420+
def test_handle_login_with_google_option_2_unset_project(
421+
monkeypatch: pytest.MonkeyPatch,
422+
) -> None:
423+
"""User selects 2, goes through express sign up, and unsets existing gcloud project."""
424+
monkeypatch.setattr(gcp_utils, "check_adc", lambda: True)
425+
monkeypatch.setattr(gcp_utils, "retrieve_express_project", lambda: None)
426+
monkeypatch.setattr(gcp_utils, "list_gcp_projects", lambda limit: [])
427+
monkeypatch.setattr(gcp_utils, "check_express_eligibility", lambda: True)
428+
429+
confirms = iter([True, True])
430+
monkeypatch.setattr(click, "confirm", lambda *a, **k: next(confirms))
431+
432+
prompts = iter(["2", "1"])
433+
monkeypatch.setattr(click, "prompt", lambda *a, **k: next(prompts))
434+
435+
monkeypatch.setattr(
436+
gcp_utils,
437+
"sign_up_express",
438+
lambda location="us-central1": {
439+
"api_key": "new-key",
440+
"project_id": "new-proj",
441+
"region": location,
442+
},
443+
)
444+
445+
monkeypatch.setattr(
446+
cli_create, "_get_gcp_project_from_gcloud", lambda: "old-proj"
447+
)
448+
449+
called = {}
450+
451+
def fake_run(cmd, **kwargs):
452+
if cmd == ["gcloud", "config", "unset", "project"]:
453+
called["unset"] = True
454+
return subprocess.CompletedProcess(args=cmd, returncode=0)
455+
raise ValueError(f"Unexpected command: {cmd}")
456+
457+
monkeypatch.setattr(subprocess, "run", fake_run)
458+
459+
api_key, proj, region = cli_create._handle_login_with_google()
460+
assert api_key == "new-key"
461+
assert proj == "new-proj"
462+
assert region == "us-central1"
463+
assert called.get("unset") is True
464+
465+
420466
def test_handle_login_with_google_option_3(
421467
monkeypatch: pytest.MonkeyPatch,
422468
) -> None:

tests/unittests/models/test_gemma_llm.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ def llm_request_with_tools():
8787
)
8888

8989

90+
def test_supported_models_matches_gemma4():
91+
"""Gemma 4 model strings must resolve to the Gemma class via the registry."""
92+
assert models.LLMRegistry.resolve("gemma-4-31b-it") is Gemma
93+
94+
95+
def test_supported_models_matches_gemma3():
96+
"""Gemma 3 model strings must continue to resolve to the Gemma class."""
97+
assert models.LLMRegistry.resolve("gemma-3-27b-it") is Gemma
98+
99+
90100
@pytest.mark.asyncio
91101
async def test_not_gemma_model():
92102
llm = Gemma()

tests/unittests/tools/bigquery/test_bigquery_tool_config.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ def reset_warned_features():
2727
_WARNED_FEATURES.clear()
2828

2929

30-
def test_bigquery_tool_config_experimental_warning():
31-
"""Test BigQueryToolConfig experimental warning."""
32-
with warnings.catch_warnings(record=True) as w:
33-
BigQueryToolConfig()
34-
assert len(w) == 1
35-
assert "BIG_QUERY_TOOL_CONFIG is enabled." in str(w[0].message)
36-
37-
3830
def test_bigquery_tool_config_invalid_property():
3931
"""Test BigQueryToolConfig raises exception when setting invalid property."""
4032
with pytest.raises(

0 commit comments

Comments
 (0)