@@ -144,7 +144,7 @@ def test_message_to_dict(self, chat_messages):
144
144
)
145
145
@pytest .mark .integration
146
146
def test_live_run (self ):
147
- chat_messages = [ChatMessage .from_user (content = "What's the capital of France" )]
147
+ chat_messages = [ChatMessage .from_user ("What's the capital of France" )]
148
148
component = CohereChatGenerator (generation_kwargs = {"temperature" : 0.8 })
149
149
results = component .run (chat_messages )
150
150
assert len (results ["replies" ]) == 1
@@ -181,7 +181,7 @@ def __call__(self, chunk: StreamingChunk) -> None:
181
181
182
182
callback = Callback ()
183
183
component = CohereChatGenerator (streaming_callback = callback )
184
- results = component .run ([ChatMessage .from_user (content = "What's the capital of France? answer in a word" )])
184
+ results = component .run ([ChatMessage .from_user ("What's the capital of France? answer in a word" )])
185
185
186
186
assert len (results ["replies" ]) == 1
187
187
message : ChatMessage = results ["replies" ][0 ]
@@ -202,7 +202,7 @@ def __call__(self, chunk: StreamingChunk) -> None:
202
202
)
203
203
@pytest .mark .integration
204
204
def test_live_run_with_connector (self ):
205
- chat_messages = [ChatMessage .from_user (content = "What's the capital of France" )]
205
+ chat_messages = [ChatMessage .from_user ("What's the capital of France" )]
206
206
component = CohereChatGenerator (generation_kwargs = {"temperature" : 0.8 })
207
207
results = component .run (chat_messages , generation_kwargs = {"connectors" : [{"id" : "web-search" }]})
208
208
assert len (results ["replies" ]) == 1
@@ -227,7 +227,7 @@ def __call__(self, chunk: StreamingChunk) -> None:
227
227
self .responses += chunk .content if chunk .content else ""
228
228
229
229
callback = Callback ()
230
- chat_messages = [ChatMessage .from_user (content = "What's the capital of France? answer in a word" )]
230
+ chat_messages = [ChatMessage .from_user ("What's the capital of France? answer in a word" )]
231
231
component = CohereChatGenerator (streaming_callback = callback )
232
232
results = component .run (chat_messages , generation_kwargs = {"connectors" : [{"id" : "web-search" }]})
233
233
0 commit comments