diff --git a/changai/changai/api/v2/assets/metaschema_clean_v2.json b/changai/changai/api/v2/assets/metaschema_clean_v2.json index 53d2f7c..6ae2285 100644 --- a/changai/changai/api/v2/assets/metaschema_clean_v2.json +++ b/changai/changai/api/v2/assets/metaschema_clean_v2.json @@ -2975,6 +2975,7 @@ "language": "TEXT", "customer_details": "TEXT", "customer_home_address_test": "TEXT", + "test_field": "TEXT", "customer_primary_address": "TEXT", "primary_address": "TEXT", "customer_primary_contact": "TEXT", diff --git a/changai/changai/api/v2/auto_gen_api.py b/changai/changai/api/v2/auto_gen_api.py index 5767a25..d4df8ca 100644 --- a/changai/changai/api/v2/auto_gen_api.py +++ b/changai/changai/api/v2/auto_gen_api.py @@ -587,10 +587,6 @@ def fill_missing_field_descriptions( meta["last_desc_sync"] = str(now_datetime()) _save_schema_checkpoint(meta, tables_blocks) - # Commit checkpoint immediately so schema sync metadata is persisted - # even if later background processing fails. - frappe.db.commit() # nosemgrep: frappe-semgrep-rules.rules.frappe-manual-commit - return { "ok": True, "tables_updated": updated_tables, @@ -658,8 +654,6 @@ def sync_tables_and_schema_smart() -> Dict[str, Any]: except Exception as e: return {"ok": False, "error": str(e)} - frappe.db.commit() # nosemgrep: frappe-manual-commit - return { "ok": True, "changed_tables": len(changed_tables), @@ -853,8 +847,6 @@ def _process_pending_field_batches( field["description"] = desc_map[field_name].strip() updated_fields += 1 updated_in_table += 1 - # Required checkpoint commit: this long-running schema enrichment job calls external APIs and must persist partial progress to avoid losing completed batch updates on failure/retry. - frappe.db.commit() # nosemgrep return { "updated_in_table": updated_in_table, "updated_fields": updated_fields, diff --git a/changai/changai/api/v2/create_qr.py b/changai/changai/api/v2/create_qr.py index 5b08ddd..1639c28 100644 --- a/changai/changai/api/v2/create_qr.py +++ b/changai/changai/api/v2/create_qr.py @@ -11,7 +11,6 @@ from base64 import b64encode import io import os -@frappe.whitelist() def create_qr_code(doc,method): """Create QR Code after inserting Employee""" if not hasattr(doc, 'custom_qr_code'): diff --git a/changai/changai/api/v2/format_output.py b/changai/changai/api/v2/format_output.py index c0f2562..90f485e 100644 --- a/changai/changai/api/v2/format_output.py +++ b/changai/changai/api/v2/format_output.py @@ -591,16 +591,6 @@ def local_format(sql: str, sample_rows: List[Dict[str, Any]]): result = format_sql_response(sql, row_count, sample_rows) return result -def format_data_conversationally(user_data: Any) -> str: - # Safe: CONVERSATION_TEMPLATE is a hardcoded internal template string. - # User SQL result is passed only as data context, not as template source. - # nosemgrep: frappe-semgrep-rules.rules.security.frappe-ssti - return render_template( - CONVERSATION_TEMPLATE, # nosemgrep: frappe-semgrep-rules.rules.security.frappe-ssti - - {"data": user_data} - ) - def format_data(qstn: str, sql_data: Any) -> Dict[str, str]: if isinstance(sql_data, (dict, list)): db_result_json = json.dumps(sql_data, ensure_ascii=False, default=str) diff --git a/changai/changai/api/v2/fvs_stores/erpnext/report_fvs/index.faiss b/changai/changai/api/v2/fvs_stores/erpnext/report_fvs/index.faiss index 1135cf5..8645b46 100644 Binary files a/changai/changai/api/v2/fvs_stores/erpnext/report_fvs/index.faiss and b/changai/changai/api/v2/fvs_stores/erpnext/report_fvs/index.faiss differ diff --git a/changai/changai/api/v2/fvs_stores/erpnext/table_fvs/index.faiss b/changai/changai/api/v2/fvs_stores/erpnext/table_fvs/index.faiss index 34b68ec..8734fe8 100644 Binary files a/changai/changai/api/v2/fvs_stores/erpnext/table_fvs/index.faiss and b/changai/changai/api/v2/fvs_stores/erpnext/table_fvs/index.faiss differ diff --git a/changai/changai/api/v2/gdoc_ai.py b/changai/changai/api/v2/gdoc_ai.py deleted file mode 100644 index e69de29..0000000 diff --git a/changai/changai/api/v2/text2sql_pipeline_v2.py b/changai/changai/api/v2/text2sql_pipeline_v2.py index d366ddb..6496110 100644 --- a/changai/changai/api/v2/text2sql_pipeline_v2.py +++ b/changai/changai/api/v2/text2sql_pipeline_v2.py @@ -51,7 +51,6 @@ _error_response ) from changai.changai.api.v2.format_output import ( - format_data_conversationally, format_data ) diff --git a/changai/hooks.py b/changai/hooks.py index b178468..4d30b11 100644 --- a/changai/hooks.py +++ b/changai/hooks.py @@ -175,6 +175,7 @@ "on_update": "changai.changai.api.v2.create_qr.create_qr_code", } + # "File":{"after_insert":"changai.changai.api.v2.gdoc_ai.on_file_upload"} # # "*": { # # "on_update": "method", # # "on_cancel": "method",