Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Commit c3046bf

Browse files
committed
Update tools.py
1 parent a0ef300 commit c3046bf

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/controlflow/tools/tools.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,8 @@ class Tool(ControlFlowModel):
5454
_lc_tool: Optional[langchain_core.tools.BaseTool] = None
5555

5656
def to_lc_tool(self) -> dict:
57-
if self._lc_tool is None:
58-
self._lc_tool = langchain_core.tools.StructuredTool.from_function(
59-
self.fn,
60-
name=self.name,
61-
description=self.description,
62-
)
63-
64-
return self._lc_tool
57+
payload = self.model_dump(include={"name", "description", "parameters"})
58+
return payload
6559

6660
@prefect_task(task_run_name="Tool call: {self.name}")
6761
def run(self, input: dict):

0 commit comments

Comments
 (0)