@@ -53,18 +53,18 @@ class TestGeminiDepModelConfig(unittest.TestCase):
5353 def test_gemini_deployed_model_config (self ):
5454 "Test if model config parameters passed as arguments are used"
5555 model = GeminiModel (
56- project_id = "test_project_id" , api_key = "secret-key " , model_name = "gemini-test "
56+ project_id = "test_project_id" , model_name = "gemini-test " , location = "us-central1 "
5757 )
5858
5959 self .assertEqual (model .project_id , "test_project_id" )
60- self .assertEqual (model .api_key , "secret-key " )
60+ self .assertEqual (model .location , "us-central1 " )
6161 self .assertEqual (model .model_name , "gemini-test" )
6262
6363 @patch .dict (
6464 "os.environ" ,
6565 {
6666 "GOOGLE_PROJECT_ID" : "test_project_id" ,
67- "GOOGLE_API_KEY " : "secret-key " ,
67+ "LOCATION " : "us-central1 " ,
6868 "MODEL" : "gemini-test" ,
6969 },
7070 )
@@ -73,23 +73,23 @@ def test_gemini_deployed_model_config_env_var(self):
7373 model = GeminiModel ()
7474
7575 self .assertEqual (model .project_id , "test_project_id" )
76- self .assertEqual (model .api_key , "secret-key " )
76+ self .assertEqual (model .location , "us-central1 " )
7777 self .assertEqual (model .model_name , "gemini-test" )
7878
7979 @patch .dict (
8080 "os.environ" ,
8181 {
8282 "GOOGLE_PROJECT_ID" : "test_project_id" ,
83- "GOOGLE_API_KEY " : "secret-env-key " ,
83+ "LOCATION " : "us-central1 " ,
8484 "MODEL" : "gemini-test" ,
8585 },
8686 )
8787 def test_gemini_deployed_model_config_priority (self ):
8888 "Test if model config parameters passed directly get priority"
8989 model = GeminiModel (
90- project_id = "test_project_id" , api_key = "secret-key " , model_name = "gemini_test "
90+ project_id = "test_project_id" , model_name = "gemini_test " , location = "us-central1 "
9191 )
9292
93- self .assertEqual (model .project_id , "test_project_id" )
94- self .assertEqual (model .api_key , "secret-key " )
93+ self .assertEqual (model .project_id , "test_project_id" )
94+ self .assertEqual (model .location , "us-central1 " )
9595 self .assertEqual (model .model_name , "gemini_test" )
0 commit comments