bluenevus commited on
Commit
511c546
·
1 Parent(s): 0092a89

Update app.py via AI Editor

Browse files
Files changed (1) hide show
  1. app.py +19 -2
app.py CHANGED
@@ -205,10 +205,10 @@ def process_document(action, selected_filename=None, chat_input=None, selected_p
205
  logging.error(f"Failed to read generated document: {e}")
206
 
207
  prompt = (
208
- "Respond to the following RFP/SOW/PWS/RFI provided and focus on the Generated Document provided by creating a highly detailed proposal response that follows each section and subsection header and numbering. "
209
  "The response to each section and subsection will be compliant and compelling, focusing on describing the approach, and how the labor category uses a specific industry standard process in a workflow described in steps, and how technology is used. "
210
  "You must show innovation in the approach. Refer to research that validates the approach and cite sources with measurable outcome. "
211
- "Be sure to respond in paragraph format only, no numbering, no bullets, only paragraph describing in detail.\n"
212
  )
213
  if chat_input:
214
  prompt += f"User additional instructions: {chat_input}\n"
@@ -520,6 +520,22 @@ def master_callback(
520
  'recover-action-btn', 'board-action-btn', 'loe-action-btn'
521
  ]
522
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  if triggered_id in action_buttons:
524
  result = ""
525
  generated_docx_bytes = None
@@ -534,6 +550,7 @@ def master_callback(
534
  new_selected_generated = generated_docx_name
535
 
536
  elif triggered_id == 'generate-action-btn':
 
537
  result, generated_docx_bytes, generated_docx_name = process_document('generate', selected_filename, chat_input)
538
  if generated_docx_bytes and generated_docx_name:
539
  generated_documents[generated_docx_name] = generated_docx_bytes
 
205
  logging.error(f"Failed to read generated document: {e}")
206
 
207
  prompt = (
208
+ "Respond to the following RFP/SOW/PWS/RFI provided and focus on the Generated Document provided by creating a highly detailed proposal response that follows each section and subsection header. "
209
  "The response to each section and subsection will be compliant and compelling, focusing on describing the approach, and how the labor category uses a specific industry standard process in a workflow described in steps, and how technology is used. "
210
  "You must show innovation in the approach. Refer to research that validates the approach and cite sources with measurable outcome. "
211
+ "Be sure to respond in paragraph format only, never use numbering, or bullets, only paragraph describing in detail.\n"
212
  )
213
  if chat_input:
214
  prompt += f"User additional instructions: {chat_input}\n"
 
520
  'recover-action-btn', 'board-action-btn', 'loe-action-btn'
521
  ]
522
 
523
+ # Show loading message for Proposal button before running the long operation
524
+ if triggered_id == 'generate-action-btn':
525
+ output_data_upload = html.Div("Generating response...", style={"wordWrap": "break-word"})
526
+ return (
527
+ uploaded_doc_list,
528
+ doc_options,
529
+ doc_value,
530
+ proposal_options,
531
+ proposal_value,
532
+ uploaded_proposal_list,
533
+ generated_doc_list,
534
+ generated_doc_options,
535
+ generated_doc_value,
536
+ output_data_upload
537
+ )
538
+
539
  if triggered_id in action_buttons:
540
  result = ""
541
  generated_docx_bytes = None
 
550
  new_selected_generated = generated_docx_name
551
 
552
  elif triggered_id == 'generate-action-btn':
553
+ # This block is now unreachable due to early return above
554
  result, generated_docx_bytes, generated_docx_name = process_document('generate', selected_filename, chat_input)
555
  if generated_docx_bytes and generated_docx_name:
556
  generated_documents[generated_docx_name] = generated_docx_bytes