1616
1717from google .adk .utils .model_name_utils import extract_model_name
1818from google .adk .utils .model_name_utils import is_gemini_1_model
19- from google .adk .utils .model_name_utils import is_gemini_2_or_above
19+ from google .adk .utils .model_name_utils import is_gemini_eap_or_2_or_above
2020from google .adk .utils .model_name_utils import is_gemini_model
2121from google .adk .utils .model_name_utils import is_gemini_model_id_check_disabled
2222
@@ -189,50 +189,56 @@ def test_is_gemini_1_model_edge_cases(self):
189189
190190
191191class TestIsGemini2Model :
192- """Test the is_gemini_2_or_above function."""
192+ """Test the is_gemini_eap_or_2_or_above function."""
193193
194- def test_is_gemini_2_or_above_simple_names (self ):
194+ def test_is_gemini_eap_or_2_or_above_simple_names (self ):
195195 """Test Gemini 2.0+ model detection with simple model names."""
196- assert is_gemini_2_or_above ('gemini-2.5-flash' ) is True
197- assert is_gemini_2_or_above ('gemini-2.5-pro' ) is True
198- assert is_gemini_2_or_above ('gemini-2.9-experimental' ) is True
199- assert is_gemini_2_or_above ('gemini-2-pro' ) is True
200- assert is_gemini_2_or_above ('gemini-2' ) is True
201- assert is_gemini_2_or_above ('gemini-3.0-pro' ) is True
202- assert is_gemini_2_or_above ('gemini-1.5-flash' ) is False
203- assert is_gemini_2_or_above ('gemini-1.0-pro' ) is False
204- assert is_gemini_2_or_above ('claude-3-sonnet' ) is False
205-
206- def test_is_gemini_2_or_above_path_based_names (self ):
196+ assert is_gemini_eap_or_2_or_above ('gemini-2.5-flash' ) is True
197+ assert is_gemini_eap_or_2_or_above ('gemini-2.5-pro' ) is True
198+ assert is_gemini_eap_or_2_or_above ('gemini-2.9-experimental' ) is True
199+ assert is_gemini_eap_or_2_or_above ('gemini-2-pro' ) is True
200+ assert is_gemini_eap_or_2_or_above ('gemini-2' ) is True
201+ assert is_gemini_eap_or_2_or_above ('gemini-3.0-pro' ) is True
202+ assert is_gemini_eap_or_2_or_above ('gemini-flash-early-exp' ) is True
203+ assert is_gemini_eap_or_2_or_above ('gemini-flash-early-exp3' ) is True
204+ assert is_gemini_eap_or_2_or_above ('gemini-flash-lite-early-exp' ) is True
205+ assert is_gemini_eap_or_2_or_above ('gemini-pro-early-exp' ) is True
206+ assert is_gemini_eap_or_2_or_above ('gemini-1.5-flash' ) is False
207+ assert is_gemini_eap_or_2_or_above ('gemini-1.0-pro' ) is False
208+ assert is_gemini_eap_or_2_or_above ('claude-3-sonnet' ) is False
209+
210+ def test_is_gemini_eap_or_2_or_above_path_based_names (self ):
207211 """Test Gemini 2.0+ model detection with path-based model names."""
208212 gemini_2_path = 'projects/265104255505/locations/us-central1/publishers/google/models/gemini-2.5-flash'
209- assert is_gemini_2_or_above (gemini_2_path ) is True
213+ assert is_gemini_eap_or_2_or_above (gemini_2_path ) is True
210214
211215 gemini_2_path_2 = 'projects/12345/locations/us-east1/publishers/google/models/gemini-2.5-pro-preview'
212- assert is_gemini_2_or_above (gemini_2_path_2 ) is True
216+ assert is_gemini_eap_or_2_or_above (gemini_2_path_2 ) is True
213217
214218 gemini_1_path = 'projects/265104255505/locations/us-central1/publishers/google/models/gemini-1.5-flash'
215- assert is_gemini_2_or_above (gemini_1_path ) is False
219+ assert is_gemini_eap_or_2_or_above (gemini_1_path ) is False
216220
217221 gemini_3_path = 'projects/12345/locations/us-east1/publishers/google/models/gemini-3.0-pro'
218- assert is_gemini_2_or_above (gemini_3_path ) is True
222+ assert is_gemini_eap_or_2_or_above (gemini_3_path ) is True
219223
220- def test_is_gemini_2_or_above_edge_cases (self ):
224+ def test_is_gemini_eap_or_2_or_above_edge_cases (self ):
221225 """Test edge cases for Gemini 2.0+ model detection."""
222226 # Test with None
223- assert is_gemini_2_or_above (None ) is False
227+ assert is_gemini_eap_or_2_or_above (None ) is False
224228
225229 # Test with empty string
226- assert is_gemini_2_or_above ('' ) is False
230+ assert is_gemini_eap_or_2_or_above ('' ) is False
227231
228232 # Test with model names containing gemini-2 but not starting with it
229- assert is_gemini_2_or_above ('my-gemini-2.5-model' ) is False
230- assert is_gemini_2_or_above ('custom-gemini-2.5-flash' ) is False
233+ assert is_gemini_eap_or_2_or_above ('my-gemini-2.5-model' ) is False
234+ assert is_gemini_eap_or_2_or_above ('custom-gemini-2.5-flash' ) is False
231235
232236 # Test with invalid versions
233- assert is_gemini_2_or_above ('gemini-2.' ) is False # Missing version number
234- assert is_gemini_2_or_above ('gemini-0.9-test' ) is False
235- assert is_gemini_2_or_above ('gemini-one' ) is False
237+ assert (
238+ is_gemini_eap_or_2_or_above ('gemini-2.' ) is False
239+ ) # Missing version number
240+ assert is_gemini_eap_or_2_or_above ('gemini-0.9-test' ) is False
241+ assert is_gemini_eap_or_2_or_above ('gemini-one' ) is False
236242
237243
238244class TestModelNameUtilsIntegration :
@@ -255,14 +261,14 @@ def test_model_classification_consistency(self):
255261 for model in test_models :
256262 # A model can only be either Gemini 1.x or Gemini 2.0+, not both
257263 if is_gemini_1_model (model ):
258- assert not is_gemini_2_or_above (
264+ assert not is_gemini_eap_or_2_or_above (
259265 model
260266 ), f'Model { model } classified as both Gemini 1.x and 2.0+'
261267 assert is_gemini_model (
262268 model
263269 ), f'Model { model } is Gemini 1.x but not classified as Gemini'
264270
265- if is_gemini_2_or_above (model ):
271+ if is_gemini_eap_or_2_or_above (model ):
266272 assert not is_gemini_1_model (
267273 model
268274 ), f'Model { model } classified as both Gemini 1.x and 2.0+'
@@ -271,7 +277,9 @@ def test_model_classification_consistency(self):
271277 ), f'Model { model } is Gemini 2.0+ but not classified as Gemini'
272278
273279 # If it's neither Gemini 1.x nor 2.0+, it should not be classified as Gemini
274- if not is_gemini_1_model (model ) and not is_gemini_2_or_above (model ):
280+ if not is_gemini_1_model (model ) and not is_gemini_eap_or_2_or_above (
281+ model
282+ ):
275283 if model and 'gemini-' not in extract_model_name (model ):
276284 assert not is_gemini_model (
277285 model
@@ -312,9 +320,9 @@ def test_path_vs_simple_model_consistency(self):
312320 f'Inconsistent Gemini 1.x classification for { simple_model } vs'
313321 f' { path_model } '
314322 )
315- assert is_gemini_2_or_above ( simple_model ) == is_gemini_2_or_above (
316- path_model
317- ), (
323+ assert is_gemini_eap_or_2_or_above (
324+ simple_model
325+ ) == is_gemini_eap_or_2_or_above ( path_model ) , (
318326 f'Inconsistent Gemini 2.0+ classification for { simple_model } vs'
319327 f' { path_model } '
320328 )
0 commit comments