From 158131db7fcd1075775aa80747c07a24d197d2d7 Mon Sep 17 00:00:00 2001 From: peilongchencc Date: Thu, 23 May 2024 15:09:38 +0800 Subject: [PATCH 1/3] Optimize the usage of in the function within . --- src/vanna/base/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vanna/base/base.py b/src/vanna/base/base.py index 0299fe81..2859ead4 100644 --- a/src/vanna/base/base.py +++ b/src/vanna/base/base.py @@ -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: From ff7a65d0f22f04ee992c256d5e1909de7589060a Mon Sep 17 00:00:00 2001 From: peilongchencc Date: Thu, 23 May 2024 15:12:25 +0800 Subject: [PATCH 2/3] Add the parameter allow_llm_to_see_data=False to the ask function --- src/vanna/base/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vanna/base/base.py b/src/vanna/base/base.py index 2859ead4..9870ee88 100644 --- a/src/vanna/base/base.py +++ b/src/vanna/base/base.py @@ -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], From 68e2a26e87b85bfba04a9ee351b61975ede0682a Mon Sep 17 00:00:00 2001 From: peilongchencc Date: Thu, 23 May 2024 15:23:16 +0800 Subject: [PATCH 3/3] fix the usage of allow_llm_to_see_data --- src/vanna/base/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vanna/base/base.py b/src/vanna/base/base.py index 9870ee88..ca68b20d 100644 --- a/src/vanna/base/base.py +++ b/src/vanna/base/base.py @@ -1628,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