vanna 0.4.1__py3-none-any.whl → 0.4.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
vanna/base/base.py CHANGED
@@ -124,6 +124,11 @@ class VannaBase(ABC):
124
124
  return self.extract_sql(llm_response)
125
125
 
126
126
  def extract_sql(self, llm_response: str) -> str:
127
+ # If the llm_response contains a CTE (with clause), extract the sql bewteen WITH and ;
128
+ sql = re.search(r"WITH.*?;", llm_response, re.DOTALL)
129
+ if sql:
130
+ self.log(f"Output from LLM: {llm_response} \nExtracted SQL: {sql.group(0)}")
131
+ return sql.group(0)
127
132
  # If the llm_response is not markdown formatted, extract sql by finding select and ; in the response
128
133
  sql = re.search(r"SELECT.*?;", llm_response, re.DOTALL)
129
134
  if sql:
@@ -131,11 +136,6 @@ class VannaBase(ABC):
131
136
  )
132
137
  return sql.group(0)
133
138
 
134
- # If the llm_response contains a CTE (with clause), extract the sql bewteen WITH and ;
135
- sql = re.search(r"WITH.*?;", llm_response, re.DOTALL)
136
- if sql:
137
- self.log(f"Output from LLM: {llm_response} \nExtracted SQL: {sql.group(0)}")
138
- return sql.group(0)
139
139
  # If the llm_response contains a markdown code block, with or without the sql tag, extract the sql from it
140
140
  sql = re.search(r"```sql\n(.*)```", llm_response, re.DOTALL)
141
141
  if sql:
@@ -1,46 +1,46 @@
1
- class ImproperlyConfigured(BaseException):
1
+ class ImproperlyConfigured(Exception):
2
2
  """Raise for incorrect configuration."""
3
3
 
4
4
  pass
5
5
 
6
6
 
7
- class DependencyError(BaseException):
7
+ class DependencyError(Exception):
8
8
  """Raise for missing dependencies."""
9
9
 
10
10
  pass
11
11
 
12
12
 
13
- class ConnectionError(BaseException):
13
+ class ConnectionError(Exception):
14
14
  """Raise for connection"""
15
15
 
16
16
  pass
17
17
 
18
18
 
19
- class OTPCodeError(BaseException):
19
+ class OTPCodeError(Exception):
20
20
  """Raise for invalid otp or not able to send it"""
21
21
 
22
22
  pass
23
23
 
24
24
 
25
- class SQLRemoveError(BaseException):
25
+ class SQLRemoveError(Exception):
26
26
  """Raise when not able to remove SQL"""
27
27
 
28
28
  pass
29
29
 
30
30
 
31
- class ExecutionError(BaseException):
31
+ class ExecutionError(Exception):
32
32
  """Raise when not able to execute Code"""
33
33
 
34
34
  pass
35
35
 
36
36
 
37
- class ValidationError(BaseException):
37
+ class ValidationError(Exception):
38
38
  """Raise for validations"""
39
39
 
40
40
  pass
41
41
 
42
42
 
43
- class APIError(BaseException):
43
+ class APIError(Exception):
44
44
  """Raise for API errors"""
45
45
 
46
46
  pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vanna
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Generate SQL queries from natural language
5
5
  Author-email: Zain Hoda <zain@vanna.ai>
6
6
  Requires-Python: >=3.9
@@ -8,10 +8,10 @@ vanna/ZhipuAI/__init__.py,sha256=NlsijtcZp5Tj9jkOe9fNcOQND_QsGgu7otODsCLBPr0,116
8
8
  vanna/anthropic/__init__.py,sha256=85s_2mAyyPxc0T_0JEvYeAkEKWJwkwqoyUwSC5dw9Gk,43
9
9
  vanna/anthropic/anthropic_chat.py,sha256=Wk0o-NMW1uvR2fhSWxrR_2FqNh-dLprNG4uuVqpqAkY,2615
10
10
  vanna/base/__init__.py,sha256=Sl-HM1RRYzAZoSqmL1CZQmF3ZF-byYTCFQP3JZ2A5MU,28
11
- vanna/base/base.py,sha256=_2vANGAcUe6IrsEhZyFnE6FdO8NMLylfyGlRI4XujWE,58143
11
+ vanna/base/base.py,sha256=aGsswvx53XN-S7cYg874-3Ewb7iLLjus_fZ7KwHQcdw,58145
12
12
  vanna/chromadb/__init__.py,sha256=-iL0nW_g4uM8nWKMuWnNePfN4nb9uk8P3WzGvezOqRg,50
13
13
  vanna/chromadb/chromadb_vector.py,sha256=eKyPck99Y6Jt-BNWojvxLG-zvAERzLSm-3zY-bKXvaA,8792
14
- vanna/exceptions/__init__.py,sha256=N76unE7sjbGGBz6LmCrPQAugFWr9cUFv8ErJxBrCTts,717
14
+ vanna/exceptions/__init__.py,sha256=dJ65xxxZh1lqBeg6nz6Tq_r34jLVmjvBvPO9Q6hFaQ8,685
15
15
  vanna/flask/__init__.py,sha256=5Du2oK5s-VSLicRPvxMAL1-Gh_jdX847FjJOf5AVapo,23721
16
16
  vanna/flask/assets.py,sha256=ZESgn0-XrJl4_YV69Lu7Dr7-Y9Eql7xqb7PsoMzrofw,183889
17
17
  vanna/flask/auth.py,sha256=UpKxh7W5cd43W0LGch0VqhncKwB78L6dtOQkl1JY5T0,1246
@@ -31,6 +31,6 @@ vanna/qdrant/qdrant.py,sha256=XlesB0UniR0LmiXvQ8Ct7o19EdCZPuvUgvyzYSlp94c,11940
31
31
  vanna/types/__init__.py,sha256=Qhn_YscKtJh7mFPCyCDLa2K8a4ORLMGVnPpTbv9uB2U,4957
32
32
  vanna/vannadb/__init__.py,sha256=C6UkYocmO6dmzfPKZaWojN0mI5YlZZ9VIbdcquBE58A,48
33
33
  vanna/vannadb/vannadb_vector.py,sha256=9YwTO3Lh5owWQE7KPMBqLp2EkiGV0RC1sEYhslzJzgI,6168
34
- vanna-0.4.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
35
- vanna-0.4.1.dist-info/METADATA,sha256=SwU235jbylf7gJ4VwDXtz7bLhUF5uTV0IdPCnK1HH68,10512
36
- vanna-0.4.1.dist-info/RECORD,,
34
+ vanna-0.4.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
35
+ vanna-0.4.3.dist-info/METADATA,sha256=mdtz7Vk3wdOzbq23jTLPmR9daOkacBhABElbus-1Kck,10512
36
+ vanna-0.4.3.dist-info/RECORD,,
File without changes