banko-ai-assistant 1.0.9__py3-none-any.whl → 1.0.11__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.
banko_ai/cli.py CHANGED
@@ -73,8 +73,8 @@ def run(host, port, debug, generate_data, no_data, clear_data, background):
73
73
  click.echo("Clearing existing data...")
74
74
  generator.clear_expenses()
75
75
 
76
- generator.generate_and_save(generate_data)
77
- click.echo(f"✅ Successfully generated {generate_data} expense records")
76
+ actual_count = generator.generate_and_save(generate_data)
77
+ click.echo(f"✅ Successfully generated {actual_count} expense records")
78
78
  except Exception as e:
79
79
  click.echo(f"❌ Error generating data: {e}")
80
80
  return
@@ -220,8 +220,8 @@ def start(host, port, generate_data, no_data, clear_data):
220
220
  click.echo("Clearing existing data...")
221
221
  generator.clear_expenses()
222
222
 
223
- generator.generate_and_save(generate_data)
224
- click.echo(f"✅ Successfully generated {generate_data} expense records")
223
+ actual_count = generator.generate_and_save(generate_data)
224
+ click.echo(f"✅ Successfully generated {actual_count} expense records")
225
225
  except Exception as e:
226
226
  click.echo(f"❌ Error generating data: {e}")
227
227
  return
@@ -250,6 +250,9 @@ class EnhancedExpenseGenerator:
250
250
  # Insert in smaller batches to reduce transaction conflicts
251
251
  batch_size = 50 # Reduced from 100 to minimize conflicts
252
252
  total_inserted = 0
253
+ total_batches = (len(data_to_insert) + batch_size - 1) // batch_size
254
+
255
+ print(f"📊 Inserting {len(data_to_insert)} records in {total_batches} batches of {batch_size}")
253
256
 
254
257
  for i in range(0, len(data_to_insert), batch_size):
255
258
  batch = data_to_insert[i:i + batch_size]
@@ -260,12 +263,14 @@ class EnhancedExpenseGenerator:
260
263
 
261
264
  while retry_count < max_retries:
262
265
  try:
263
- with self.engine.connect() as conn:
266
+ with self.engine.begin() as conn:
264
267
  # Use pandas to insert the batch
265
268
  df = pd.DataFrame(batch)
266
269
  df.to_sql('expenses', conn, if_exists='append', index=False, method='multi')
267
- conn.commit()
270
+ # Transaction is automatically committed when exiting the context
268
271
  total_inserted += len(batch)
272
+ batch_num = i//batch_size + 1
273
+ print(f"✅ Batch {batch_num}/{total_batches}: {len(batch)} records inserted (Total: {total_inserted})")
269
274
  break # Success, exit retry loop
270
275
 
271
276
  except OperationalError as e:
@@ -306,9 +311,9 @@ class EnhancedExpenseGenerator:
306
311
 
307
312
  while retry_count < max_retries:
308
313
  try:
309
- with self.engine.connect() as conn:
314
+ with self.engine.begin() as conn:
310
315
  conn.execute(text("DELETE FROM expenses"))
311
- conn.commit()
316
+ # Transaction is automatically committed when exiting the context
312
317
  return True
313
318
 
314
319
  except OperationalError as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: banko-ai-assistant
3
- Version: 1.0.9
3
+ Version: 1.0.11
4
4
  Summary: AI-powered expense analysis and RAG system with CockroachDB vector search and multi-provider AI support
5
5
  Author-email: Virag Tripathi <virag.tripathi@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  banko_ai/__init__.py,sha256=G1InyKemqQxP9xx6yGZgolBmrmOLSpBXqGYY8LaFOeo,568
2
2
  banko_ai/__main__.py,sha256=vySUZt0uAzogVu6yURIlLJ1Ig5bdxT_55oiiaiZKqA8,185
3
- banko_ai/cli.py,sha256=LgnGaUqsbtrymOru1IJsgTW98rN3zoq6UGKkbR8ojs8,13732
3
+ banko_ai/cli.py,sha256=SsCsikOykmTM_uId-n0ivilKXu1hKch17XXwhMHfFnU,13760
4
4
  banko_ai/ai_providers/__init__.py,sha256=JdBgw5Mji2pe9nU-aiRYUmJuZk0q8KbcMtbpMJC5Dq8,483
5
5
  banko_ai/ai_providers/aws_provider.py,sha256=-tR-8tlEeSL-Fspx05tTMFguvQylkW_pz0PI2XJEByM,13074
6
6
  banko_ai/ai_providers/base.py,sha256=zbuAgkHIfJ0YkG83LXzieJuvXBcB2-nx7NhbL-I4Pf0,4725
@@ -151,14 +151,14 @@ banko_ai/utils/database.py,sha256=sJYAFTApkWReEJuMbbBDiz7XfgiiEd6lPSSyF6BQDpk,77
151
151
  banko_ai/utils/migration.py,sha256=j1lYUVZyYMcMvxZUOFymoK19QTPqkDZFXD-iysVCnQo,4764
152
152
  banko_ai/vector_search/__init__.py,sha256=vYksnkUU4FA8XBNzYZIH4FoGjXCx9oIbrDeapSzrNuE,621
153
153
  banko_ai/vector_search/enrichment.py,sha256=sRnFLNG9WGfq8j44T7krxHI-Lc2RSH68mt0IT0GTHBA,10203
154
- banko_ai/vector_search/generator.py,sha256=l5DdeAiPBHLkbMnFvX03rTSn4b9JS2jiP_Pf_A6Lxpk,16437
154
+ banko_ai/vector_search/generator.py,sha256=BAs26Uwt-8VP9xPsTdooxznLnr674uX_jr41_oKZKL8,16912
155
155
  banko_ai/vector_search/search.py,sha256=k3wo3zFJH9o-kBc-vAS-bdmM3LGX2vIk3u4cRA5QPXo,16915
156
156
  banko_ai/web/__init__.py,sha256=hjWVVxYpIZhOAN1qBf4xTd36a5AUHM03Q8BF8pykhJQ,363
157
157
  banko_ai/web/app.py,sha256=9xBe6RsyEUQvpDhsRckJ4pzk5x2RZWEhVs8DiJg4zqs,27675
158
158
  banko_ai/web/auth.py,sha256=js6qIixSFHyLbETDm8GNLCPrDkCDcaQZPFOrqtZP1uw,2125
159
- banko_ai_assistant-1.0.9.dist-info/licenses/LICENSE,sha256=skG0LkywIClj8fgSIXiG6o9vUDJ678BKBObIyJ19OMw,1075
160
- banko_ai_assistant-1.0.9.dist-info/METADATA,sha256=fRuFpSdfmLnibvN9_9DAN-AyTDY6a2hTsAIFOp2E1wc,13243
161
- banko_ai_assistant-1.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
162
- banko_ai_assistant-1.0.9.dist-info/entry_points.txt,sha256=IxPjBjMvbpCp-ikCA43bOSbYboTGPX4HYcZlvu2_vcA,47
163
- banko_ai_assistant-1.0.9.dist-info/top_level.txt,sha256=xNMa9Z67UssefOQ2ubFObtqUYIfYmCIclfz0xdo5OPE,9
164
- banko_ai_assistant-1.0.9.dist-info/RECORD,,
159
+ banko_ai_assistant-1.0.11.dist-info/licenses/LICENSE,sha256=skG0LkywIClj8fgSIXiG6o9vUDJ678BKBObIyJ19OMw,1075
160
+ banko_ai_assistant-1.0.11.dist-info/METADATA,sha256=FSL0Rqnj0OMpI_pM6mxE0VReiQblRa3tT5AZ-1QpLQA,13244
161
+ banko_ai_assistant-1.0.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
162
+ banko_ai_assistant-1.0.11.dist-info/entry_points.txt,sha256=IxPjBjMvbpCp-ikCA43bOSbYboTGPX4HYcZlvu2_vcA,47
163
+ banko_ai_assistant-1.0.11.dist-info/top_level.txt,sha256=xNMa9Z67UssefOQ2ubFObtqUYIfYmCIclfz0xdo5OPE,9
164
+ banko_ai_assistant-1.0.11.dist-info/RECORD,,