Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1049,10 +1049,10 @@ def generate_prompt_from_excel_file(df_dict):
|
|
1049 |
{sample_table}.
|
1050 |
"""
|
1051 |
|
1052 |
-
prompt += f"- Query: A natural language question (e.g., List all the employees whose names start with 'A'). The question should be sent as 'What are the employee details with name starts with a'."
|
1053 |
-
prompt += f"""Output : {docstatus}. Here is the sample table:
|
1054 |
-
|
1055 |
-
|
1056 |
|
1057 |
prompt += f"- Query: A natural language question with request to create LOA document (e.g., can you create LOA document for all the employees with broker name XXXX). The question should be sent as 'What are the employee details with broker name XXXX : LOA document'."
|
1058 |
prompt += f"""Output: {docstatus}. Here is the sample table:
|
@@ -1185,7 +1185,8 @@ def chat_with_excel_data_dataframe(question):
|
|
1185 |
else:
|
1186 |
print("The result is a message.")
|
1187 |
return response_dataframe
|
1188 |
-
|
|
|
1189 |
#handle large dataset
|
1190 |
response = handle_large_dataset(response_dataframe, create_document,isDataFrame)
|
1191 |
|
|
|
1049 |
{sample_table}.
|
1050 |
"""
|
1051 |
|
1052 |
+
#prompt += f"- Query: A natural language question (e.g., List all the employees whose names start with 'A'). The question should be sent as 'What are the employee details with name starts with a'."
|
1053 |
+
#prompt += f"""Output : {docstatus}. Here is the sample table:
|
1054 |
+
# {sample_table}.
|
1055 |
+
# """
|
1056 |
|
1057 |
prompt += f"- Query: A natural language question with request to create LOA document (e.g., can you create LOA document for all the employees with broker name XXXX). The question should be sent as 'What are the employee details with broker name XXXX : LOA document'."
|
1058 |
prompt += f"""Output: {docstatus}. Here is the sample table:
|
|
|
1185 |
else:
|
1186 |
print("The result is a message.")
|
1187 |
return response_dataframe
|
1188 |
+
if len(response_dataframe) == 0:
|
1189 |
+
return "There is no employee with the name you requested. Please rephrase your query."
|
1190 |
#handle large dataset
|
1191 |
response = handle_large_dataset(response_dataframe, create_document,isDataFrame)
|
1192 |
|