Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQLSearchTool Error #122

Open
neelkanani opened this issue Nov 17, 2024 · 2 comments
Open

MySQLSearchTool Error #122

neelkanani opened this issue Nov 17, 2024 · 2 comments

Comments

@neelkanani
Copy link

This is the error on the terminal

raise AttributeError(f"Unsupported argument '{key}'") from None
AttributeError: Unsupported argument 'url'
An error occurred while running the flow: Command '['uv', 'run', 'kickoff']' returned non-zero exit status 1.

mysql_search_tool.py
line no - 29
kwargs["loader"] = MySQLLoader(config=dict(url=self.db_uri))

MySQLLoader not longer accepts the url I think ! and which has made this feature run into error

@noname-nohost
Copy link

In the file:
crewai_tools/tools/mysql_search_tool

the class init should be something like this:

    def __init__(self, table_name: str, host: str, port: str, database: str, user: str, password: str, **kwargs):
        super().__init__(**kwargs)
        kwargs["data_type"] = "mysql"
        config = {
            "host": host,
            "port": port,
            "database": database,
            "user": user,
            "password": password,
        }
        kwargs["loader"] = MySQLLoader(config=config)
        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()

And then call it like this:

    sql_tool = MySQLSearchTool(
        db_uri=db_uri,
        host=host,
        port=port,
        database=database,
        user=user,
        password=password,
        table_name=table_name,
        ...

@neelkanani
Copy link
Author

Yeah !, I did create a custom tool to make it work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants