Skip to content

Commit aca79a4

Browse files
authored
fix: Fix ollama unit test (#2523)
* fix test * make test work with latest and earlier versions of haystack * fix
1 parent 98bb315 commit aca79a4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

integrations/ollama/tests/test_chat_generator.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_convert_ollama_response_to_chatmessage(self):
137137
assert observed.role == "assistant"
138138
assert observed.text == "Hello! How are you today?"
139139

140-
assert observed.meta == {
140+
expected_data = {
141141
"finish_reason": "stop",
142142
"usage": {
143143
"completion_tokens": 298,
@@ -153,6 +153,11 @@ def test_convert_ollama_response_to_chatmessage(self):
153153
"model": "some_model",
154154
}
155155

156+
if "logprobs" in observed.meta:
157+
expected_data["logprobs"] = None
158+
159+
assert observed.meta == expected_data
160+
156161
def test_convert_ollama_response_to_chatmessage_with_tools(self):
157162
model = "some_model"
158163

0 commit comments

Comments
 (0)