docs/concepts/tool_calling/ #28109
Replies: 4 comments 4 replies
-
it seems like bind_tools requires list of list. I guess this might be better: |
Beta Was this translation helpful? Give feedback.
-
## tool 1:
tavily_search_tool = TavilySearchResults(max_results=2)
## tool 2:
from langchain_core.tools import tool
@tool(name_or_callable="magic_words")
def magic_words(username: str) -> str:
"""answer a dynamic password if user want to know magic words
Args:
username: name of user, or "<UNKNOWN>" if you don't know the username.
"""
mw = "xxxxxxxxxx" + username
print(mw)
return mw
## tool 3
from langchain_core.tools import tool
@tool
def multiply(a: int, b: int) -> int:
"""Multiply a and b."""
return a * b
# -----
tools = [tavily_search_tool, magic_words, multiply]
llm_with_tools = llm.bind_tools(tools) I can get currect result with tavily_search
is anything wrong? |
Beta Was this translation helpful? Give feedback.
-
can we bind tools with hugging face model ?, whic is load like I'm using HuggingFace model |
Beta Was this translation helpful? Give feedback.
-
Can we call another tool from another tool that is defined in the same stategraph? |
Beta Was this translation helpful? Give feedback.
-
docs/concepts/tool_calling/
https://python.langchain.com/docs/concepts/tool_calling/
Beta Was this translation helpful? Give feedback.
All reactions