@@ -79,7 +79,7 @@ def test_init_default(self, monkeypatch):
7979 monkeypatch .setenv ("AZURE_OPENAI_API_KEY" , "test-api-key" )
8080 component = AzureOpenAIChatGenerator (azure_endpoint = "some-non-existing-endpoint" )
8181 assert component .client .api_key == "test-api-key"
82- assert component .azure_deployment == "gpt-4o -mini"
82+ assert component .azure_deployment == "gpt-4.1 -mini"
8383 assert component .streaming_callback is None
8484 assert not component .generation_kwargs
8585
@@ -100,7 +100,7 @@ def test_init_with_parameters(self, tools):
100100 azure_ad_token_provider = default_azure_ad_token_provider ,
101101 )
102102 assert component .client .api_key == "test-api-key"
103- assert component .azure_deployment == "gpt-4o -mini"
103+ assert component .azure_deployment == "gpt-4.1 -mini"
104104 assert component .streaming_callback is print_streaming_chunk
105105 assert component .generation_kwargs == {"max_completion_tokens" : 10 , "some_test_param" : "test-params" }
106106 assert component .tools == tools
@@ -121,7 +121,7 @@ def test_init_with_0_max_retries(self, tools):
121121 max_retries = 0 ,
122122 )
123123 assert component .client .api_key == "test-api-key"
124- assert component .azure_deployment == "gpt-4o -mini"
124+ assert component .azure_deployment == "gpt-4.1 -mini"
125125 assert component .streaming_callback is print_streaming_chunk
126126 assert component .generation_kwargs == {"max_completion_tokens" : 10 , "some_test_param" : "test-params" }
127127 assert component .tools == tools
@@ -138,9 +138,9 @@ def test_to_dict_default(self, monkeypatch):
138138 "init_parameters" : {
139139 "api_key" : {"env_vars" : ["AZURE_OPENAI_API_KEY" ], "strict" : False , "type" : "env_var" },
140140 "azure_ad_token" : {"env_vars" : ["AZURE_OPENAI_AD_TOKEN" ], "strict" : False , "type" : "env_var" },
141- "api_version" : "2023-05-15 " ,
141+ "api_version" : "2024-12-01-preview " ,
142142 "azure_endpoint" : "some-non-existing-endpoint" ,
143- "azure_deployment" : "gpt-4o -mini" ,
143+ "azure_deployment" : "gpt-4.1 -mini" ,
144144 "organization" : None ,
145145 "streaming_callback" : None ,
146146 "generation_kwargs" : {},
@@ -177,9 +177,9 @@ def test_to_dict_with_parameters(self, monkeypatch, calendar_event_model):
177177 "init_parameters" : {
178178 "api_key" : {"env_vars" : ["ENV_VAR" ], "strict" : False , "type" : "env_var" },
179179 "azure_ad_token" : {"env_vars" : ["ENV_VAR1" ], "strict" : False , "type" : "env_var" },
180- "api_version" : "2023-05-15 " ,
180+ "api_version" : "2024-12-01-preview " ,
181181 "azure_endpoint" : "some-non-existing-endpoint" ,
182- "azure_deployment" : "gpt-4o -mini" ,
182+ "azure_deployment" : "gpt-4.1 -mini" ,
183183 "organization" : None ,
184184 "streaming_callback" : "haystack.components.generators.utils.print_streaming_chunk" ,
185185 "timeout" : 2.5 ,
@@ -222,9 +222,9 @@ def test_from_dict(self, monkeypatch):
222222 "init_parameters" : {
223223 "api_key" : {"env_vars" : ["AZURE_OPENAI_API_KEY" ], "strict" : False , "type" : "env_var" },
224224 "azure_ad_token" : {"env_vars" : ["AZURE_OPENAI_AD_TOKEN" ], "strict" : False , "type" : "env_var" },
225- "api_version" : "2023-05-15 " ,
225+ "api_version" : "2024-12-01-preview " ,
226226 "azure_endpoint" : "some-non-existing-endpoint" ,
227- "azure_deployment" : "gpt-4o -mini" ,
227+ "azure_deployment" : "gpt-4.1 -mini" ,
228228 "organization" : None ,
229229 "streaming_callback" : None ,
230230 "generation_kwargs" : {},
@@ -252,9 +252,9 @@ def test_from_dict(self, monkeypatch):
252252
253253 assert generator .api_key == Secret .from_env_var ("AZURE_OPENAI_API_KEY" , strict = False )
254254 assert generator .azure_ad_token == Secret .from_env_var ("AZURE_OPENAI_AD_TOKEN" , strict = False )
255- assert generator .api_version == "2023-05-15 "
255+ assert generator .api_version == "2024-12-01-preview "
256256 assert generator .azure_endpoint == "some-non-existing-endpoint"
257- assert generator .azure_deployment == "gpt-4o -mini"
257+ assert generator .azure_deployment == "gpt-4.1 -mini"
258258 assert generator .organization is None
259259 assert generator .streaming_callback is None
260260 assert generator .generation_kwargs == {}
@@ -282,9 +282,9 @@ def test_pipeline_serialization_deserialization(self, tmp_path, monkeypatch):
282282 "type" : "haystack.components.generators.chat.azure.AzureOpenAIChatGenerator" ,
283283 "init_parameters" : {
284284 "azure_endpoint" : "some-non-existing-endpoint" ,
285- "azure_deployment" : "gpt-4o -mini" ,
285+ "azure_deployment" : "gpt-4.1 -mini" ,
286286 "organization" : None ,
287- "api_version" : "2023-05-15 " ,
287+ "api_version" : "2024-12-01-preview " ,
288288 "streaming_callback" : None ,
289289 "generation_kwargs" : {},
290290 "timeout" : 30.0 ,
@@ -341,7 +341,7 @@ def test_live_run(self):
341341 assert len (results ["replies" ]) == 1
342342 message : ChatMessage = results ["replies" ][0 ]
343343 assert "Paris" in message .text
344- assert "gpt-4o -mini" in message .meta ["model" ]
344+ assert "gpt-4.1 -mini" in message .meta ["model" ]
345345 assert message .meta ["finish_reason" ] == "stop"
346346
347347 @pytest .mark .integration
@@ -544,7 +544,7 @@ def test_init_should_also_create_async_client_with_same_args(self, tools):
544544 tools_strict = True ,
545545 )
546546 assert component .async_client .api_key == "test-api-key"
547- assert component .azure_deployment == "gpt-4o -mini"
547+ assert component .azure_deployment == "gpt-4.1 -mini"
548548 assert component .streaming_callback is print_streaming_chunk
549549 assert component .generation_kwargs == {"max_completion_tokens" : 10 , "some_test_param" : "test-params" }
550550 assert component .tools == tools
@@ -567,7 +567,7 @@ async def test_live_run_async(self):
567567 assert len (results ["replies" ]) == 1
568568 message : ChatMessage = results ["replies" ][0 ]
569569 assert "Paris" in message .text
570- assert "gpt-4o " in message .meta ["model" ]
570+ assert "gpt-4.1-mini " in message .meta ["model" ]
571571 assert message .meta ["finish_reason" ] == "stop"
572572
573573 @pytest .mark .integration
0 commit comments