Skip to content

Commit

Permalink
Update tools.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Sep 13, 2024
1 parent a0ef300 commit c3046bf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/controlflow/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,8 @@ class Tool(ControlFlowModel):
_lc_tool: Optional[langchain_core.tools.BaseTool] = None

def to_lc_tool(self) -> dict:
if self._lc_tool is None:
self._lc_tool = langchain_core.tools.StructuredTool.from_function(
self.fn,
name=self.name,
description=self.description,
)

return self._lc_tool
payload = self.model_dump(include={"name", "description", "parameters"})
return payload

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

0 comments on commit c3046bf

Please sign in to comment.