Currently the Assistant optionally picks a tool whenever it "thinks" it's appropriate to do so (tool_choice = "auto"). There are instances when you want the Assistant to use a specific tool 100% of the time (tool_choice = { "tool_name" }). This ticket was inspired by the following discussion: https://github.com/patterns-ai-core/langchainrb/discussions/733
Proposed changes:
Introduce the @tool_choice instance variable that could be set during the initialization assistant = Langchain::Assistant.new(tool_choice: ...,) or after: assistant.tool_choice = "...".
Currently the Assistant optionally picks a tool whenever it "thinks" it's appropriate to do so (
tool_choice = "auto"
). There are instances when you want the Assistant to use a specific tool 100% of the time (tool_choice = { "tool_name" }
). This ticket was inspired by the following discussion: https://github.com/patterns-ai-core/langchainrb/discussions/733Proposed changes:
@tool_choice
instance variable that could be set during the initializationassistant = Langchain::Assistant.new(tool_choice: ...,)
or after:assistant.tool_choice = "..."
.@tool_choice
is used here, here and here.If you take any of the built-in tools, you can see a list of that Tool's functions:
This should be the value we're setting the tool_choice to: