langchain_core.tools.StructuredTool / BaseTool for tool exposure
naas_abi_core.utils.Expose.APIRouter for API exposure (stubbed)
pydantic.Field and typing.Annotated (only used in commented example)
Imports present but unused in this template:
Optional
ITripleStoreService
Usage
# Minimal usage (requires implementing run() to do anything meaningful)cfg = {{workflow_name_pascal}}WorkflowConfiguration()wf = {{workflow_name_pascal}}Workflow(cfg)# Direct invocation (currently returns None because run() is pass)result = wf.run({{workflow_name_pascal}}WorkflowParameters())print(result)# Tool exposure (LangChain)tools = wf.as_tools()tool = tools[0]out = tool.run({}) # kwargs parsed into {{workflow_name_pascal}}WorkflowParametersprint(out)
Caveats
run(...) is not implemented; as provided, it returns None.
as_api(...) is a stub and does not register any routes.
The tool created by as_tools() uses lambda **kwargs and will fail validation if you add required fields to {{workflow_name_pascal}}WorkflowParameters but do not supply them.