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

[BUG] - NL2Sql is falling #1866

Open
Neerajkumar12 opened this issue Jan 8, 2025 · 0 comments
Open

[BUG] - NL2Sql is falling #1866

Neerajkumar12 opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Neerajkumar12
Copy link

Neerajkumar12 commented Jan 8, 2025

Description

I am trying to implement NL2Sql_tool in my project, I encountered an error while trying to use the tool. This was the error: Arguments validation failed: 1 validation error for NL2SQLToolInput
sql_query, Even i am using latest version of CrewAI==0.95.0

Steps to Reproduce

image

Expected behavior

The expected behaviour is an accurate, well-optimized SQL query generated from the user's natural language input

Screenshots/Code snippets

      if tool.toolName == 'NL2SQLTool':
                  #this is not my db_uri, i have just hide it
                  db_uri = "postgresql://postgres****-postgresql-server-****** :5432"
                  if db_uri is None:
                      raise ValueError("Missing connection_url for NL2sql_tool")
                  if db_uri:
                      try:
                          nl2sql_tool = NL2SQLTool(db_uri=db_uri)
                          logger.info(f"NL2SQLTool initialized with database URI: {db_uri}")
                          
                          
                         # checking database is connected or not
                          if test_connection(db_uri):
                              logger.info("Successfully connected to the database")
  
                          agent_model.tools.append(nl2sql_tool)

Operating System

Windows 11

Python Version

3.12

crewAI Version

0.95.0

crewAI Tools Version

0.25.8

Virtual Environment

Venv

Evidence

image

Possible Solution

None

Additional context

None

@Neerajkumar12 Neerajkumar12 added the bug Something isn't working label Jan 8, 2025
@Neerajkumar12 Neerajkumar12 changed the title [BUG] [BUG] - NL2Sql is falling Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant