diff --git a/llama_cpp/llama_chat_format.py b/llama_cpp/llama_chat_format.py index ea8d07feb..5fbd54bf7 100644 --- a/llama_cpp/llama_chat_format.py +++ b/llama_cpp/llama_chat_format.py @@ -3525,7 +3525,7 @@ def chatml_function_calling( ) # Case 3: Automatic tool choice - assert isinstance(tool_choice, str) and tool_choice == "auto" + assert isinstance(tool_choice, str) and tool_choice in ["auto", "required"] function_names = " | ".join( [f'''"functions.{tool['function']['name']}:"''' for tool in tools] )