Spaces:
Sleeping
Sleeping
lakshmivairamani
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -264,8 +264,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
|
268 |
-
JOIN
|
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 +380,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
|
384 |
-
JOIN
|
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 +458,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
|
462 |
-
JOIN
|
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 +534,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
|
538 |
-
JOIN
|
539 |
WHERE pt.company_id = %s and cd.company_name=%s
|
540 |
"""
|
541 |
logging.info(f"Executing query: {query} with company_id: {company_id}")
|
|
|
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 |
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 |
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 |
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}")
|