Skip to content

How to expose as remote tool which can be called by remote Agent #349

Answered by eyurtsev
weiminw asked this question in Q&A
Discussion options

You must be logged in to vote

The best way right now is to wrap it in another function. This allows you to populate the doc-string and specify the type signature appropriately.

from langchain.tools import tool

@tool
def tell_joke(topic: str) -> str:
   """A tool that can be used to tell a joke."""
   return remote_tool.invoke({'topic': topic})

tools = [
  tell_joke
] 
...

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@weiminw
Comment options

Answer selected by eyurtsev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #348 on December 23, 2023 21:36.