admin管理员组文章数量:1122846
Using the Anthropic messsages API directly and providing multiple tools to the model, it's possible to instruct the model to only invoke one tool at a time by setting disable_parallel_tool_use=true
in the tool_choice field.
I'm using LangGraph, and I'd like to be able to do the same thing - instruct the model to only choose one tool at a time.
Below is the heart of my code. I'm leaving out the tool method definitions and prompts, because they're not directly relevant.
model = ChatAnthropic(model="claude-3-5-sonnet-20241022")
tools = [search_word_forms, search_dictionaries, WordDetermination]
model_with_tools = model.bind_tools(tools, tool_choice="any")
response = model_with_tools.invoke(state["messages"])
Using this framework, how can I instruct the model to disable parallel tool use?
本文标签: langchainUsing Langgraphinstruct Anthropic to disable parallel tool useStack Overflow
版权声明:本文标题:langchain - Using Langgraph - instruct Anthropic to disable parallel tool use - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282253a1926586.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论