Skip to content

ChatLlamaCpp Function Call(s) - Cannot pick from a list of tools #23288

Answered by dosubot bot
evan-dayy asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, @evan-dayy! I'm here to help you with any bugs, questions, or contribution guidance you may need. Let's tackle this issue together!

Yes, the ChatLlamaCpp model currently does not support choosing between tools automatically. The tool_choice parameter does not support "any" or "auto" choices like the OpenAI tool-calling API. You need to specify a specific tool to force its use.

Here's the relevant part of the bind_tools method:

def bind_tools(
    self,
    tools: Sequence[Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool]],
    *,
    tool_choice: Optional[Union[Dict[str, Dict], bool, str]] = None,
    **kwargs: Any,
) -> Runnable[LanguageModelInput, BaseMessage]:
    """B…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by evan-dayy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants