docs/concepts/tool_calling/ #28109
Replies: 2 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.
3 replies
-
## 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.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
docs/concepts/tool_calling/
https://python.langchain.com/docs/concepts/tool_calling/
Beta Was this translation helpful? Give feedback.
All reactions