mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 00:02:36 +00:00
fixed scoping issue causing error in RAG tools
This commit is contained in:
@@ -25,6 +25,8 @@ class MySQLSearchTool(RagTool):
|
||||
|
||||
def __init__(self, table_name: str, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
kwargs["data_type"] = "mysql"
|
||||
kwargs["loader"] = MySQLLoader(config=dict(url=self.db_uri))
|
||||
self.add(table_name)
|
||||
self.description = f"A tool that can be used to semantic search a query the {table_name} database table's content."
|
||||
self._generate_description()
|
||||
@@ -34,8 +36,6 @@ class MySQLSearchTool(RagTool):
|
||||
table_name: str,
|
||||
**kwargs: Any,
|
||||
) -> None:
|
||||
kwargs["data_type"] = "mysql"
|
||||
kwargs["loader"] = MySQLLoader(config=dict(url=self.db_uri))
|
||||
super().add(f"SELECT * FROM {table_name};", **kwargs)
|
||||
|
||||
def _run(
|
||||
|
||||
Reference in New Issue
Block a user