4444def test_integration_initialization () -> None :
4545 """Test chat model initialization."""
4646 llm = ChatGoogleGenerativeAI (
47- model = "gemini-nano " ,
47+ model = "gemini-2.5-flash " ,
4848 google_api_key = SecretStr ("..." ),
4949 top_k = 2 ,
5050 top_p = 1 ,
@@ -54,27 +54,27 @@ def test_integration_initialization() -> None:
5454 ls_params = llm ._get_ls_params ()
5555 assert ls_params == {
5656 "ls_provider" : "google_genai" ,
57- "ls_model_name" : "gemini-nano " ,
57+ "ls_model_name" : "gemini-2.5-flash " ,
5858 "ls_model_type" : "chat" ,
5959 "ls_temperature" : 0.7 ,
6060 }
6161
6262 llm = ChatGoogleGenerativeAI (
63- model = "gemini-nano " ,
63+ model = "gemini-2.5-flash " ,
6464 google_api_key = SecretStr ("..." ),
6565 max_output_tokens = 10 ,
6666 )
6767 ls_params = llm ._get_ls_params ()
6868 assert ls_params == {
6969 "ls_provider" : "google_genai" ,
70- "ls_model_name" : "gemini-nano " ,
70+ "ls_model_name" : "gemini-2.5-flash " ,
7171 "ls_model_type" : "chat" ,
7272 "ls_temperature" : 0.7 ,
7373 "ls_max_tokens" : 10 ,
7474 }
7575
7676 ChatGoogleGenerativeAI (
77- model = "gemini-nano " ,
77+ model = "gemini-2.5-flash " ,
7878 api_key = SecretStr ("..." ),
7979 top_k = 2 ,
8080 top_p = 1 ,
@@ -86,13 +86,13 @@ def test_integration_initialization() -> None:
8686 with warnings .catch_warnings ():
8787 warnings .simplefilter ("ignore" , UserWarning )
8888 llm = ChatGoogleGenerativeAI (
89- model = "gemini-nano " ,
89+ model = "gemini-2.5-flash " ,
9090 google_api_key = SecretStr ("..." ),
9191 safety_setting = {
9292 "HARM_CATEGORY_DANGEROUS_CONTENT" : "BLOCK_LOW_AND_ABOVE"
9393 }, # Invalid arg
9494 )
95- assert llm .model == "models/gemini-nano "
95+ assert llm .model == "models/gemini-2.5-flash "
9696 mock_warning .assert_called_once ()
9797 call_args = mock_warning .call_args [0 ][0 ]
9898 assert "Unexpected argument 'safety_setting'" in call_args
@@ -105,14 +105,14 @@ def test_initialization_inside_threadpool() -> None:
105105 with ThreadPoolExecutor () as executor :
106106 executor .submit (
107107 ChatGoogleGenerativeAI ,
108- model = "gemini-nano " ,
108+ model = "gemini-2.5-flash " ,
109109 google_api_key = SecretStr ("secret-api-key" ),
110110 ).result ()
111111
112112
113113def test_initalization_without_async () -> None :
114114 chat = ChatGoogleGenerativeAI (
115- model = "gemini-nano " ,
115+ model = "gemini-2.5-flash " ,
116116 google_api_key = SecretStr ("secret-api-key" ),
117117 )
118118 assert chat .async_client is None
@@ -121,7 +121,7 @@ def test_initalization_without_async() -> None:
121121def test_initialization_with_async () -> None :
122122 async def initialize_chat_with_async_client () -> ChatGoogleGenerativeAI :
123123 model = ChatGoogleGenerativeAI (
124- model = "gemini-nano " ,
124+ model = "gemini-2.5-flash " ,
125125 google_api_key = SecretStr ("secret-api-key" ),
126126 )
127127 _ = model .async_client
@@ -133,7 +133,7 @@ async def initialize_chat_with_async_client() -> ChatGoogleGenerativeAI:
133133
134134def test_api_key_is_string () -> None :
135135 chat = ChatGoogleGenerativeAI (
136- model = "gemini-nano " ,
136+ model = "gemini-2.5-flash " ,
137137 google_api_key = SecretStr ("secret-api-key" ),
138138 )
139139 assert isinstance (chat .google_api_key , SecretStr )
@@ -143,7 +143,7 @@ def test_api_key_masked_when_passed_via_constructor(
143143 capsys : pytest .CaptureFixture ,
144144) -> None :
145145 chat = ChatGoogleGenerativeAI (
146- model = "gemini-nano " ,
146+ model = "gemini-2.5-flash " ,
147147 google_api_key = SecretStr ("secret-api-key" ),
148148 )
149149 print (chat .google_api_key , end = "" ) # noqa: T201
@@ -349,7 +349,7 @@ def test_additional_headers_support(headers: Optional[dict[str, str]]) -> None:
349349 mock_client ,
350350 ):
351351 chat = ChatGoogleGenerativeAI (
352- model = "gemini-pro " ,
352+ model = "gemini-2.5-flash " ,
353353 google_api_key = param_secret_api_key ,
354354 client_options = param_client_options ,
355355 transport = param_transport ,
@@ -387,7 +387,7 @@ def test_default_metadata_field_alias() -> None:
387387 # error
388388 # This is the main issue: LangSmith Playground passes None to default_metadata_input
389389 chat1 = ChatGoogleGenerativeAI (
390- model = "gemini-pro " ,
390+ model = "gemini-2.5-flash " ,
391391 google_api_key = SecretStr ("test-key" ),
392392 default_metadata_input = None ,
393393 )
@@ -398,7 +398,7 @@ def test_default_metadata_field_alias() -> None:
398398 # Test with empty list for default_metadata_input (should not cause validation
399399 # error)
400400 chat2 = ChatGoogleGenerativeAI (
401- model = "gemini-pro " ,
401+ model = "gemini-2.5-flash " ,
402402 google_api_key = SecretStr ("test-key" ),
403403 default_metadata_input = [],
404404 )
@@ -407,7 +407,7 @@ def test_default_metadata_field_alias() -> None:
407407
408408 # Test with tuple for default_metadata_input (should not cause validation error)
409409 chat3 = ChatGoogleGenerativeAI (
410- model = "gemini-pro " ,
410+ model = "gemini-2.5-flash " ,
411411 google_api_key = SecretStr ("test-key" ),
412412 default_metadata_input = [("X-Test" , "test" )],
413413 )
@@ -716,7 +716,7 @@ def test_parse_response_candidate(raw_candidate: dict, expected: AIMessage) -> N
716716
717717
718718def test_serialize () -> None :
719- llm = ChatGoogleGenerativeAI (model = "gemini-pro-1.5 " , google_api_key = "test-key" )
719+ llm = ChatGoogleGenerativeAI (model = "gemini-2.5-flash " , google_api_key = "test-key" )
720720 serialized = dumps (llm )
721721 llm_loaded = loads (
722722 serialized ,
0 commit comments