How unittest a tool in the latest versions? #28455
-
Checked other resources
Commit to Help
Example Codee from langchain_core.runnables.config import RunnableConfig
@tool()
def search_knowledge_base_tool(question: str, config: RunnableConfig):
"""longdescription
"""
user_id = config['configurable']['user_id'] My testcase
DescriptionI'm trying to write a unittest for this tool. Ah, this tool works fine when executing it in our normal flow ( agent setup etc ) System Info
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@marcoaleixo You need to pass the config as a second parameter in the invocation: search_knowledge_base_tool.invoke(input_data, config) |
Beta Was this translation helpful? Give feedback.
@marcoaleixo You need to pass the config as a second parameter in the invocation: