Fixing imports and cutting new patch

This commit is contained in:
João Moura
2024-08-11 00:46:32 -03:00
parent d861dcc3c4
commit 5dd49762e3
4 changed files with 41 additions and 15 deletions

View File

@@ -1,10 +1,18 @@
from typing import Any, Union
from crewai_tools import BaseTool
from ..base_tool import BaseTool
from pydantic import Field
from sqlalchemy import create_engine, text
from sqlalchemy.orm import sessionmaker
from typing import Optional, Type, Any
from pydantic.v1 import BaseModel
class NL2SQLToolInput(BaseModel):
sql_query: str = Field(
title="SQL Query",
description="The SQL query to execute.",
)
class NL2SQLTool(BaseTool):
name: str = "NL2SQLTool"
@@ -15,6 +23,7 @@ class NL2SQLTool(BaseTool):
)
tables: list = []
columns: dict = {}
args_schema: Type[BaseModel] = NL2SQLToolInput
def model_post_init(self, __context: Any) -> None:
data = {}