@@ -211,7 +211,7 @@ def test_from_dict(self, mock_boto3_session: Any, boto3_config: dict[str, Any] |
211211 "aws_session_token" : {"type" : "env_var" , "env_vars" : ["AWS_SESSION_TOKEN" ], "strict" : False },
212212 "aws_region_name" : {"type" : "env_var" , "env_vars" : ["AWS_DEFAULT_REGION" ], "strict" : False },
213213 "aws_profile_name" : {"type" : "env_var" , "env_vars" : ["AWS_PROFILE" ], "strict" : False },
214- "model" : "anthropic.claude-3-5- sonnet-20240620-v1:0 " ,
214+ "model" : "global. anthropic.claude-sonnet-4-6 " ,
215215 "generation_kwargs" : {"temperature" : 0.7 },
216216 "streaming_callback" : "haystack.components.generators.utils.print_streaming_chunk" ,
217217 "boto3_config" : boto3_config ,
@@ -221,16 +221,16 @@ def test_from_dict(self, mock_boto3_session: Any, boto3_config: dict[str, Any] |
221221 },
222222 }
223223 )
224- assert generator .model == "anthropic.claude-3-5- sonnet-20240620-v1:0 "
224+ assert generator .model == "global. anthropic.claude-sonnet-4-6 "
225225 assert generator .streaming_callback == print_streaming_chunk
226226 assert generator .boto3_config == boto3_config
227227
228228 def test_default_constructor (self , mock_boto3_session , mock_aioboto3_session , set_env_variables ):
229229 """
230230 Test that the default constructor sets the correct values
231231 """
232- layer = AmazonBedrockChatGenerator (model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " )
233- assert layer .model == "anthropic.claude-3-5- sonnet-20240620-v1:0 "
232+ layer = AmazonBedrockChatGenerator (model = "global. anthropic.claude-sonnet-4-6 " )
233+ assert layer .model == "global. anthropic.claude-sonnet-4-6 "
234234
235235 # assert mocked boto3 client called exactly once
236236 mock_boto3_session .assert_called_once ()
@@ -250,7 +250,7 @@ def test_constructor_with_generation_kwargs(self, mock_boto3_session):
250250 """
251251 generation_kwargs = {"temperature" : 0.7 }
252252 layer = AmazonBedrockChatGenerator (
253- model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " , generation_kwargs = generation_kwargs
253+ model = "global. anthropic.claude-sonnet-4-6 " , generation_kwargs = generation_kwargs
254254 )
255255 assert layer .generation_kwargs == generation_kwargs
256256
@@ -276,7 +276,7 @@ def test_serde_in_pipeline(self, mock_boto3_session, monkeypatch):
276276 )
277277
278278 generator = AmazonBedrockChatGenerator (
279- model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " ,
279+ model = "global. anthropic.claude-sonnet-4-6 " ,
280280 generation_kwargs = {"temperature" : 0.7 , "stopSequences" : ["eviscerate" ]},
281281 streaming_callback = print_streaming_chunk ,
282282 tools = [tool ],
@@ -303,7 +303,7 @@ def test_serde_in_pipeline(self, mock_boto3_session, monkeypatch):
303303 "aws_session_token" : {"type" : "env_var" , "env_vars" : ["AWS_SESSION_TOKEN" ], "strict" : False },
304304 "aws_region_name" : {"type" : "env_var" , "env_vars" : ["AWS_DEFAULT_REGION" ], "strict" : False },
305305 "aws_profile_name" : {"type" : "env_var" , "env_vars" : ["AWS_PROFILE" ], "strict" : False },
306- "model" : "anthropic.claude-3-5- sonnet-20240620-v1:0 " ,
306+ "model" : "global. anthropic.claude-sonnet-4-6 " ,
307307 "generation_kwargs" : {"temperature" : 0.7 , "stopSequences" : ["eviscerate" ]},
308308 "streaming_callback" : "haystack.components.generators.utils.print_streaming_chunk" ,
309309 "boto3_config" : None ,
@@ -335,7 +335,7 @@ def test_serde_in_pipeline(self, mock_boto3_session, monkeypatch):
335335 assert pipeline_dict == expected_dict
336336
337337 def test_prepare_request_params_tool_config (self , top_song_tool_config , mock_boto3_session , set_env_variables ):
338- generator = AmazonBedrockChatGenerator (model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " )
338+ generator = AmazonBedrockChatGenerator (model = "global. anthropic.claude-sonnet-4-6 " )
339339 request_params , _ = generator ._prepare_request_params (
340340 messages = [ChatMessage .from_user ("What's the capital of France?" )],
341341 generation_kwargs = {"toolConfig" : top_song_tool_config },
@@ -346,7 +346,7 @@ def test_prepare_request_params_tool_config(self, top_song_tool_config, mock_bot
346346
347347 def test_prepare_request_params_guardrail_config (self , mock_boto3_session , set_env_variables ):
348348 generator = AmazonBedrockChatGenerator (
349- model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " ,
349+ model = "global. anthropic.claude-sonnet-4-6 " ,
350350 guardrail_config = {"guardrailIdentifier" : "test" , "guardrailVersion" : "test" },
351351 )
352352 request_params , _ = generator ._prepare_request_params (
@@ -374,7 +374,7 @@ def tool_fn(city: str) -> str:
374374 toolset = Toolset ([population_tool ])
375375
376376 generator = AmazonBedrockChatGenerator (
377- model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " ,
377+ model = "global. anthropic.claude-sonnet-4-6 " ,
378378 tools = [weather_tool , toolset ],
379379 )
380380
@@ -398,7 +398,7 @@ def tool_fn(city: str) -> str:
398398 )
399399 toolset = Toolset ([population_tool ])
400400
401- generator = AmazonBedrockChatGenerator (model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " )
401+ generator = AmazonBedrockChatGenerator (model = "global. anthropic.claude-sonnet-4-6 " )
402402 request_params , _ = generator ._prepare_request_params (
403403 messages = [ChatMessage .from_user ("What's the capital of France?" )],
404404 tools = [weather_tool , toolset ],
@@ -487,7 +487,7 @@ def tool_fn(city: str) -> str:
487487 def test_prepare_request_params_with_flattened_generation_kwargs (
488488 self , mock_boto3_session , set_env_variables , generation_kwargs , additional_model_request_fields
489489 ):
490- generator = AmazonBedrockChatGenerator (model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " )
490+ generator = AmazonBedrockChatGenerator (model = "global. anthropic.claude-sonnet-4-6 " )
491491 request_params , _ = generator ._prepare_request_params (
492492 messages = [ChatMessage .from_user ("What's the capital of France?" )],
493493 generation_kwargs = generation_kwargs ,
@@ -969,7 +969,7 @@ def test_live_run_with_tool_with_no_args_streaming(self, tool_with_no_parameters
969969 def test_live_run_with_guardrail (self , streaming_callback ):
970970 messages = [ChatMessage .from_user ("Should I invest in Tesla or Apple?" )]
971971 component = AmazonBedrockChatGenerator (
972- model = "anthropic.claude-3-5- sonnet-20240620-v1:0 " ,
972+ model = "global. anthropic.claude-sonnet-4-6 " ,
973973 guardrail_config = {
974974 "guardrailIdentifier" : os .getenv ("AWS_BEDROCK_GUARDRAIL_ID" ),
975975 "guardrailVersion" : os .getenv ("AWS_BEDROCK_GUARDRAIL_VERSION" ),
0 commit comments