lakshmivairamani commited on
Commit
3046de1
·
verified ·
1 Parent(s): eda9d4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -48,7 +48,6 @@ app.add_middleware(
48
  allow_methods=["*"],
49
  allow_headers=["*"],
50
  )
51
-
52
  DB_USER = 'u852023448_redmindgpt'
53
  DB_PASSWORD = 'redmindGpt@123'
54
  DB_HOST = '217.21.88.10'
@@ -264,8 +263,8 @@ async def get_document(company_id: str = Query(...), company_name: str = Query(.
264
  cursor = cnx.cursor()
265
  query = """
266
  SELECT kb.company_id, kb.file_path, kb.document_name, kb.document_desc,kb.department,kb.version,kb.vectorDBflag,kb.last_updated
267
- FROM knowledge_base kb
268
- JOIN company_detail cd ON kb.company_id = cd.company_id
269
  WHERE kb.company_id = %s and cd.company_name=%s
270
  """
271
  logging.info(f"Executing query: {query} with company_id: {company_id}")
@@ -380,8 +379,8 @@ async def get_data_connectors(company_id: str = Query(...), company_name: str =
380
  cursor = cnx.cursor()
381
  query = """
382
  SELECT dc.company_id, dc.databasetype, dc.serverip, dc.port,dc.database_name, dc.username, dc.password ,dc.dbtablename
383
- FROM data_connectors dc
384
- JOIN company_detail cd ON dc.company_id = cd.company_id
385
  WHERE dc.company_id = %s and cd.company_name=%s
386
  """
387
  logging.info(f"Executing query: {query} with company_id: {company_id}")
@@ -458,8 +457,8 @@ async def get_api_connectors(company_id: str = Query(...), company_name: str = Q
458
  cursor = cnx.cursor()
459
  query = """
460
  SELECT ac.company_id, ac.api_name, ac.api_endpoint,ac.auth_token,ac.input_param, ac.output_json, ac.description
461
- FROM api_connectors ac
462
- JOIN company_detail cd ON ac.company_id = cd.company_id
463
  WHERE ac.company_id = %s and cd.company_name=%s
464
  """
465
  logging.info(f"Executing query: {query} with company_id: {company_id}")
@@ -534,8 +533,8 @@ async def get_prompt_connectors(company_id: str = Query(...), company_name: str
534
  cursor = cnx.cursor()
535
  query = """
536
  SELECT pt.company_id,pt.scenario,pt.prompts,pt.comments
537
- FROM prompt_templates pt
538
- JOIN company_detail cd ON pt.company_id = cd.company_id
539
  WHERE pt.company_id = %s and cd.company_name=%s
540
  """
541
  logging.info(f"Executing query: {query} with company_id: {company_id}")
 
48
  allow_methods=["*"],
49
  allow_headers=["*"],
50
  )
 
51
  DB_USER = 'u852023448_redmindgpt'
52
  DB_PASSWORD = 'redmindGpt@123'
53
  DB_HOST = '217.21.88.10'
 
263
  cursor = cnx.cursor()
264
  query = """
265
  SELECT kb.company_id, kb.file_path, kb.document_name, kb.document_desc,kb.department,kb.version,kb.vectorDBflag,kb.last_updated
266
+ FROM u852023448_redmindgpt.knowledge_base kb
267
+ JOIN u852023448_redmindgpt.company_detail cd ON kb.company_id = cd.company_id
268
  WHERE kb.company_id = %s and cd.company_name=%s
269
  """
270
  logging.info(f"Executing query: {query} with company_id: {company_id}")
 
379
  cursor = cnx.cursor()
380
  query = """
381
  SELECT dc.company_id, dc.databasetype, dc.serverip, dc.port,dc.database_name, dc.username, dc.password ,dc.dbtablename
382
+ FROM u852023448_redmindgpt.data_connectors dc
383
+ JOIN u852023448_redmindgpt.company_detail cd ON dc.company_id = cd.company_id
384
  WHERE dc.company_id = %s and cd.company_name=%s
385
  """
386
  logging.info(f"Executing query: {query} with company_id: {company_id}")
 
457
  cursor = cnx.cursor()
458
  query = """
459
  SELECT ac.company_id, ac.api_name, ac.api_endpoint,ac.auth_token,ac.input_param, ac.output_json, ac.description
460
+ FROM u852023448_redmindgpt.api_connectors ac
461
+ JOIN u852023448_redmindgpt.company_detail cd ON ac.company_id = cd.company_id
462
  WHERE ac.company_id = %s and cd.company_name=%s
463
  """
464
  logging.info(f"Executing query: {query} with company_id: {company_id}")
 
533
  cursor = cnx.cursor()
534
  query = """
535
  SELECT pt.company_id,pt.scenario,pt.prompts,pt.comments
536
+ FROM u852023448_redmindgpt.prompt_templates pt
537
+ JOIN u852023448_redmindgpt.company_detail cd ON pt.company_id = cd.company_id
538
  WHERE pt.company_id = %s and cd.company_name=%s
539
  """
540
  logging.info(f"Executing query: {query} with company_id: {company_id}")