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

Two optimizations: log and allow_llm_to_see_data #454

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/vanna/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def __init__(self, config=None):
self.language = self.config.get("language", None)

def log(self, message: str, title: str = "Info"):
print(message)
print(f"{title}: {message}")

def _response_language(self) -> str:
if self.language is None:
Expand Down Expand Up @@ -1597,6 +1597,7 @@ def ask(
print_results: bool = True,
auto_train: bool = True,
visualize: bool = True, # if False, will not generate plotly code
allow_llm_to_see_data: bool = False,
) -> Union[
Tuple[
Union[str, None],
Expand Down Expand Up @@ -1627,7 +1628,7 @@ def ask(
question = input("Enter a question: ")

try:
sql = self.generate_sql(question=question)
sql = self.generate_sql(question=question, allow_llm_to_see_data=allow_llm_to_see_data)
except Exception as e:
print(e)
return None, None, None
Expand Down