Skip to content

Commit c9c7337

Browse files
committed
fix: handle multiple calls to the same tool
Fixes abetlen#1756 Signed-off-by: Jeff MAURY <[email protected]>
1 parent 4744551 commit c9c7337

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: llama_cpp/llama_chat_format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3714,7 +3714,7 @@ def chatml_function_calling(
37143714
)
37153715
response = cast(llama_types.CreateCompletionResponse, response)
37163716

3717-
tool_name = response["choices"][0]["text"][len("functions.") :]
3717+
tool_name = response["choices"][0]["text"][len("functions.") :-1]
37183718
tool = next(
37193719
(tool for tool in tools if tool["function"]["name"] == tool_name), None
37203720
)

0 commit comments

Comments
 (0)