From e78cabbfb76b54c104647f0ee1e199a5691709a3 Mon Sep 17 00:00:00 2001 From: Zain Hoda <7146154+zainhoda@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:46:30 -0400 Subject: [PATCH] Fix generate_sql --- src/vanna/base/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vanna/base/base.py b/src/vanna/base/base.py index 0e9e9cb6..7e065ed2 100644 --- a/src/vanna/base/base.py +++ b/src/vanna/base/base.py @@ -103,7 +103,10 @@ def generate_sql(self, question: str, **kwargs) -> str: Returns: str: The SQL query that answers the question. """ - initial_prompt = self.config.get("initial_prompt", None) + if self.config is not None: + initial_prompt = self.config.get("initial_prompt", None) + else: + initial_prompt = None question_sql_list = self.get_similar_question_sql(question, **kwargs) ddl_list = self.get_related_ddl(question, **kwargs) doc_list = self.get_related_documentation(question, **kwargs)