Dave Aitel
@classmethod def from_lc_tool(cls, tool: langchain_core.tools.BaseTool, **kwargs): if isinstance(tool, langchain_core.tools.StructuredTool): fn = tool.func else: #fn = lambda *a, **k: None # noqa # For non-StructuredTool, check for _run method first, then func fn = getattr(tool, '_run', getattr(tool, 'func', lambda *a, **k: None)) return cls( name=tool.name, description=tool.description, parameters=tool.args_schema.schema(), fn=fn, **kwargs, )
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.