@@ -499,7 +499,7 @@ def test_run_image(self):
499499class TestCohereChatGeneratorInference :
500500 def test_live_run (self ):
501501 chat_messages = [ChatMessage .from_user ("What's the capital of France" )]
502- component = CohereChatGenerator (generation_kwargs = {"temperature" : 0.8 })
502+ component = CohereChatGenerator (model = "command-r7b-12-2024" , generation_kwargs = {"temperature" : 0.8 })
503503 results = component .run (chat_messages )
504504 assert len (results ["replies" ]) == 1
505505 message : ChatMessage = results ["replies" ][0 ]
@@ -525,7 +525,7 @@ def __call__(self, chunk: StreamingChunk) -> None:
525525 self .responses += chunk .content if chunk .content else ""
526526
527527 callback = Callback ()
528- component = CohereChatGenerator (streaming_callback = callback )
528+ component = CohereChatGenerator (model = "command-r7b-12-2024" , streaming_callback = callback )
529529 results = component .run ([ChatMessage .from_user ("What's the capital of France? answer in a word" )])
530530
531531 assert len (results ["replies" ]) == 1
@@ -559,7 +559,7 @@ def test_tools_use_old_way(self):
559559 },
560560 }
561561 ]
562- client = CohereChatGenerator ()
562+ client = CohereChatGenerator (model = "command-r7b-12-2024" )
563563 response = client .run (
564564 messages = [ChatMessage .from_user ("What is the current price of AAPL?" )],
565565 generation_kwargs = {"tools" : tools_schema },
@@ -595,7 +595,7 @@ def test_tools_use_with_tools(self):
595595 function = stock_price ,
596596 )
597597 initial_messages = [ChatMessage .from_user ("What is the current price of AAPL?" )]
598- client = CohereChatGenerator ()
598+ client = CohereChatGenerator (model = "command-r7b-12-2024" )
599599 response = client .run (
600600 messages = initial_messages ,
601601 tools = [stock_price_tool ],
@@ -650,7 +650,7 @@ def test_live_run_with_tools_streaming(self):
650650
651651 initial_messages = [ChatMessage .from_user ("What's the weather like in Paris?" )]
652652 component = CohereChatGenerator (
653- # Cohere's model that supports tools
653+ model = "command-r7b-12-2024" ,
654654 tools = [weather_tool ],
655655 streaming_callback = print_streaming_chunk ,
656656 )
@@ -787,7 +787,7 @@ def test_live_run_with_mixed_tools(self):
787787 initial_messages = [
788788 ChatMessage .from_user ("What's the weather like in Paris and what is the population of Berlin?" )
789789 ]
790- component = CohereChatGenerator (model = "command-r-08 -2024" , tools = mixed_tools )
790+ component = CohereChatGenerator (model = "command-r7b-12 -2024" , tools = mixed_tools )
791791 results = component .run (messages = initial_messages )
792792
793793 assert len (results ["replies" ]) > 0 , "No replies received"
0 commit comments