Forcing specific tool use
Hi @jackmpcollins, happy new year!
I had a look through the documentation, but couldn't find if there's a way to force the use of a specific tool, eg. using the tool_choice param like here for OpenAI and here for Anthropic.
Is this something that's currently possible with magentic? It's possible I missed it.
Thanks!
Hi @mnicstruwig , currently the tool_choice forces a specific tool if only one function / output type is specified.
https://github.com/jackmpcollins/magentic/blob/fd0d03edad0b2b9b685c084f933256bfaba3828e/src/magentic/chat_model/openai_chat_model.py#L423-L434
Is your use case to provide multiple tools but still force a specific one to be used? To do this I think the tool_choice param would need to be exposed in the ChatModel.complete method and to Chat.submit and @prompt/@chatprompt.