Spaces:
Runtime error
Runtime error
Update app.py
Browse files449 unmodified lines4504514524534534544554564 unmodified lines46146246346446446546646713 unmodified lines4814824834844844854864879 unmodified lines497498499500500501502503449 unmodified lines logging.error(f"Database error: {err}") raise HTTPException(status_code=500, detail="Internal Server Error") #to retrieve from knowledgebase #to retrieve from knowledgebase @app.get("/api/document_upload")async def get_document(company_id: str = Query(...), company_name: str = Query(...)): print(f"Received companyId and name: {company_id},{company_name}") # Log rec4 unmodified lines cursor = cnx.cursor() query = """ SELECT kb.kid,kb.company_id, kb.file_path, kb.document_name, kb.document_desc,kb.department,kb.version,kb.vectorDBflag,kb.last_updated FROM u852023448_redmindgp.tknowledge_base kb FROM u852023448_redmindgpt.knowledge_base kb JOIN u852023448_redmindgpt.company_detail cd ON kb.company_id = cd.company_id WHERE kb.company_id = %s and cd.company_name=%s """13 unmodified lines companies.append({ "row_id":row[0], "company_id": row[1], "file_path":row[2], "file_path":row[2], "document_name": row[3], "document_desc": row[4], "department": row[5],9 unmodified lines except mysql.connector.Error as err: logging.error(f"Database error: {err}") raise HTTPException(status_code=500, detail="Internal Server Error") #on update of modal form the data table is refresh the value in datatable @app.get("/api/document_update")async def get_document(company_id: str = Query(...)):app.py+4-4