-
I use langserve develop a chain , and expose as remote tool. my friend wants to call my chain in his agent, how to do it? Joke chain:
Agent:
agent always got error: because not there is not valid input to remote tool. |
Beta Was this translation helpful? Give feedback.
Answered by
eyurtsev
Dec 23, 2023
Replies: 1 comment 1 reply
-
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
]
... |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
eyurtsev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.