Spaces:
Runtime error
Runtime error
Update app.py
Browse files449 unmodified lines4504514524534544554564 unmodified lines46146246346446546646713 unmodified lines4814824834844854864879 unmodified lines497498499500501502503449 unmodified lineslogging.error(f"Database error: {err}")raise HTTPException(status_code=500, detail="Internal Server Error")#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 linescursor = 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_updatedFROM u852023448_redmindgp.tknowledge_base kbJOIN u852023448_redmindgpt.company_detail cd ON kb.company_id = cd.company_idWHERE kb.company_id = %s and cd.company_name=%s"""13 unmodified linescompanies.append({"row_id":row[0],"company_id": row[1],"file_path":row[2],"document_name": row[3],"document_desc": row[4],"department": row[5],9 unmodified linesexcept 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(...)):449 unmodified lines4504514524534544554564 unmodified lines46146246346446546646713 unmodified lines4814824834844854864879 unmodified lines497498499500501502503449 unmodified lineslogging.error(f"Database error: {err}")raise HTTPException(status_code=500, detail="Internal Server Error")#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 linescursor = 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_updatedFROM u852023448_redmindgpt.knowledge_base kbJOIN u852023448_redmindgpt.company_detail cd ON kb.company_id = cd.company_idWHERE kb.company_id = %s and cd.company_name=%s"""13 unmodified linescompanies.append({"row_id":row[0],"company_id": row[1],"file_path":row[2],"document_name": row[3],"document_desc": row[4],"department": row[5],9 unmodified linesexcept 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