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:
parent
2187308ad2
commit
3163a56967
2 changed files with 4 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue