Skip to content

Fix e2e tests by switching to native Gemini integration#1375

Merged
josemontespg merged 4 commits intogoogle:mainfrom
josemontespg:fix-e2e-tests
May 8, 2026
Merged

Fix e2e tests by switching to native Gemini integration#1375
josemontespg merged 4 commits intogoogle:mainfrom
josemontespg:fix-e2e-tests

Conversation

@josemontespg
Copy link
Copy Markdown
Collaborator

@josemontespg josemontespg commented May 8, 2026

Description

This PR fixes the failed e2e tests for restaurant_finder in CI.

Error

The tests failed with the following error from LiteLLM:

litellm.NotFoundError: Vertex_ai_betaException - b'{\\n  "error": {\\n    "code": 404,\\n    "message": "models/gemini-2.5-flash is not found for API version v1beta, or is not supported for generateContent. Call ListModels to see the list of available models and their supported methods.",\\n    "status": "NOT_FOUND"\\n  }\\n}\\n'

Fix

As suggested by the warning in the logs, I switched from using LiteLlm to native Gemini integration in RestaurantAgent (samples/agent/adk/restaurant_finder/agent.py).
This avoids the issue with LiteLLM trying to use an unavailable API version.

Verification

I verified that the tests pass locally after:

  1. Switching Flutter to the beta channel (version 3.44.0-0.3.pre) to match CI.
  2. Using gemini-3-flash-preview as the model (by setting MODEL_NAME environment variable), as gemini-2.5-flash continued to return 404 errors even with the native SDK.

All 4 tests passed locally.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the restaurant finder agent from LiteLlm to the native Gemini model integration. The review feedback identifies a typo in the default model name (gemini-2.5-flash) and suggests a more robust approach for parsing model IDs from environment variables to accommodate various provider prefixes.

Comment thread samples/agent/adk/restaurant_finder/agent.py Outdated
Comment thread samples/agent/adk/restaurant_finder/agent.py Outdated
@josemontespg josemontespg marked this pull request as ready for review May 8, 2026 19:26
@josemontespg josemontespg enabled auto-merge (squash) May 8, 2026 19:27
@josemontespg josemontespg merged commit ef010fd into google:main May 8, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants