Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changai/changai/api/v2/assets/metaschema_clean_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 0 additions & 8 deletions changai/changai/api/v2/auto_gen_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion changai/changai/api/v2/create_qr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
10 changes: 0 additions & 10 deletions changai/changai/api/v2/format_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Binary file modified changai/changai/api/v2/fvs_stores/erpnext/report_fvs/index.faiss
Binary file not shown.
Binary file modified changai/changai/api/v2/fvs_stores/erpnext/table_fvs/index.faiss
Binary file not shown.
Empty file removed changai/changai/api/v2/gdoc_ai.py
Empty file.
1 change: 0 additions & 1 deletion changai/changai/api/v2/text2sql_pipeline_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
_error_response
)
from changai.changai.api.v2.format_output import (
format_data_conversationally,
format_data

)
Expand Down
1 change: 1 addition & 0 deletions changai/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading