Skip to content

Commit ebdef18

Browse files
authored
chore: llama.cpp - pin transformers test dependency; fix type error (#2784)
* test: llama.cpp - pin transformers test dependency * fix type for tool call result * explain better
1 parent f34d9b1 commit ebdef18

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

integrations/llama_cpp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dependencies = [
6767
"pytest-rerunfailures",
6868
"mypy",
6969
"pip",
70-
"transformers[sentencepiece]",
70+
"transformers[sentencepiece]<5",
7171
]
7272

7373
[tool.hatch.envs.test.scripts]

integrations/llama_cpp/src/haystack_integrations/components/generators/llama_cpp/chat/chat_generator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ def _convert_message_to_llamacpp_format(message: ChatMessage) -> ChatCompletionR
8686
if tool_call_results[0].origin.id is None:
8787
msg = "`ToolCall` must have a non-null `id` attribute to be used with llama.cpp."
8888
raise ValueError(msg)
89+
# handle list of multimodal tool call results
90+
if not isinstance(tool_call_results[0].result, str):
91+
msg = "ToolCallResult.result must be a string to be used with llama.cpp."
92+
raise ValueError(msg)
8993
return {
9094
"role": "function",
9195
"content": tool_call_results[0].result,

0 commit comments

Comments
 (0)