fix: return a standard tool for each Astra DB Tool component (#5984)

* fix: return a standard tool for each Astra DB Tool component

* Update astradb.py

* Update the type hint
This commit is contained in:
Eric Hare 2025-01-28 11:35:42 -08:00 committed by GitHub
commit 3163a56967
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -3,7 +3,7 @@ from typing import Any
from astrapy import Collection, DataAPIClient, Database
from langchain.pydantic_v1 import BaseModel, Field, create_model
from langchain_core.tools import StructuredTool
from langchain_core.tools import StructuredTool, Tool
from langflow.base.langchain_utilities.model import LCToolComponent
from langflow.io import DictInput, IntInput, SecretStrInput, StrInput
@ -111,7 +111,7 @@ class AstraDBToolComponent(LCToolComponent):
model = create_model("ToolInput", **args, __base__=BaseModel)
return {"ToolInput": model}
def build_tool(self) -> StructuredTool:
def build_tool(self) -> Tool:
"""Builds an Astra DB Collection tool.
Returns:

View file

@ -4,7 +4,7 @@ from typing import Any
import requests
from langchain.pydantic_v1 import BaseModel, Field, create_model
from langchain_core.tools import StructuredTool
from langchain_core.tools import StructuredTool, Tool
from langflow.base.langchain_utilities.model import LCToolComponent
from langflow.io import DictInput, IntInput, SecretStrInput, StrInput
@ -140,7 +140,7 @@ class AstraDBCQLToolComponent(LCToolComponent):
model = create_model("ToolInput", **args, __base__=BaseModel)
return {"ToolInput": model}
def build_tool(self) -> StructuredTool:
def build_tool(self) -> Tool:
"""Builds a Astra DB CQL Table tool.
Args: