diff --git a/pyproject.toml b/pyproject.toml index 4559ff45..8dc92258 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "google-cloud-spanner>=3.56.0, <4.0.0", # For Spanner database "google-cloud-speech>=2.30.0, <3.0.0", # For Audio Transcription "google-cloud-storage>=2.18.0, <3.0.0", # For GCS Artifact service - "google-genai>=1.21.1, <=1.40.0, !=1.37.0, !=1.38.0, !=1.39.0", # Google GenAI SDK + "google-genai>=1.41.0, <2.0.0", # Google GenAI SDK "graphviz>=0.20.2, <1.0.0", # Graphviz for graph rendering "mcp>=1.8.0, <2.0.0;python_version>='3.10'", # For MCP Toolset "opentelemetry-api>=1.37.0, <=1.37.0", # OpenTelemetry - limit upper version for sdk and api to not risk breaking changes from unstable _logs package. diff --git a/src/google/adk/tools/computer_use/computer_use_toolset.py b/src/google/adk/tools/computer_use/computer_use_toolset.py index 8834b5a4..d5c69f73 100644 --- a/src/google/adk/tools/computer_use/computer_use_toolset.py +++ b/src/google/adk/tools/computer_use/computer_use_toolset.py @@ -206,9 +206,7 @@ class ComputerUseToolset(BaseToolset): types.Environment.ENVIRONMENT_BROWSER, ) llm_request.config.tools.append( - types.Tool( - computer_use=types.ToolComputerUse(environment=environment) - ) + types.Tool(computer_use=types.ComputerUse(environment=environment)) ) logger.debug( "Added computer use tool with environment: %s", diff --git a/tests/unittests/models/test_google_llm.py b/tests/unittests/models/test_google_llm.py index 985d7e91..cd03f1dd 100644 --- a/tests/unittests/models/test_google_llm.py +++ b/tests/unittests/models/test_google_llm.py @@ -128,7 +128,7 @@ def llm_request_with_computer_use(): system_instruction="You are a helpful assistant", tools=[ types.Tool( - computer_use=types.ToolComputerUse( + computer_use=types.ComputerUse( environment=types.Environment.ENVIRONMENT_BROWSER ) ) @@ -1488,7 +1488,7 @@ async def test_computer_use_removes_system_instruction(): system_instruction="You are a helpful assistant", tools=[ types.Tool( - computer_use=types.ToolComputerUse( + computer_use=types.ComputerUse( environment=types.Environment.ENVIRONMENT_BROWSER ) ) diff --git a/tests/unittests/tools/computer_use/test_computer_use_toolset.py b/tests/unittests/tools/computer_use/test_computer_use_toolset.py index 803dddd0..6367b46c 100644 --- a/tests/unittests/tools/computer_use/test_computer_use_toolset.py +++ b/tests/unittests/tools/computer_use/test_computer_use_toolset.py @@ -370,7 +370,7 @@ class TestComputerUseToolset: config=types.GenerateContentConfig( tools=[ types.Tool( - computer_use=types.ToolComputerUse( + computer_use=types.ComputerUse( environment=types.Environment.ENVIRONMENT_BROWSER ) )