bluenevus commited on
Commit
d8a61e5
·
verified ·
1 Parent(s): 240cb50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -120,7 +120,7 @@ def evaluate_compliance(document: str, requirements: str) -> str:
120
  response = model.generate_content(prompt)
121
  return response.text
122
 
123
- def generate_red_document(document: str, compliance_report: str) -> str:
124
  prompt = f"""
125
  Based on the following document and compliance report:
126
 
@@ -130,15 +130,18 @@ def generate_red_document(document: str, compliance_report: str) -> str:
130
  Compliance Report:
131
  {compliance_report}
132
 
 
 
133
  Generate a revised "Red Team" document that addresses all issues found in the compliance report.
134
  Follow these guidelines:
135
- 1. Use Wikipedia style writing with active voice. Be firm with the approach, no soft words like could be, may be, should, might. Use definitve language.
136
  2. For each requirement, describe in detail how MicroHealth will innovate to address it.
137
  3. Explain the industry best practices that will be applied and the workflow to accomplish the steps in the best practice to address the requirement.
138
  4. Provide measurable outcomes for the customer.
139
  5. Limit the use of bullet points and write predominantly in paragraph format.
140
  6. Ensure a logical flow of steps taken by MicroHealth for each requirement.
141
  7. Where applicable, describe the labor category or labor categories that perform the task as part of the process
 
142
  """
143
  response = model.generate_content(prompt)
144
  return response.text
@@ -253,6 +256,11 @@ app.layout = dbc.Container([
253
  dcc.Download(id="download-p-review-doc")
254
  ]),
255
  dbc.Tab(label="Red", tab_id="red", children=[
 
 
 
 
 
256
  dcc.Upload(
257
  id='upload-red',
258
  children=html.Div(['Drag and Drop or ', html.A('Select Files')]),
@@ -442,9 +450,10 @@ def update_loe_output(n_clicks, upload_contents, shred_output):
442
  Input('generate-red', 'n_clicks'),
443
  State('upload-red', 'contents'),
444
  State('upload-red', 'filename'),
445
- State('p-review-output', 'children')
 
446
  )
447
- def update_red_output(n_clicks, contents, filename, p_review_output):
448
  if n_clicks is None:
449
  return "Click 'Generate Red Team Document' to begin."
450
 
@@ -455,7 +464,7 @@ def update_red_output(n_clicks, contents, filename, p_review_output):
455
  else:
456
  return "Please upload a document or complete the P.Review first."
457
 
458
- red_doc = generate_red_document(document, p_review_output)
459
  return dcc.Markdown(red_doc)
460
 
461
  @app.callback(
 
120
  response = model.generate_content(prompt)
121
  return response.text
122
 
123
+ def generate_red_document(document: str, compliance_report: str, instructions: str) -> str:
124
  prompt = f"""
125
  Based on the following document and compliance report:
126
 
 
130
  Compliance Report:
131
  {compliance_report}
132
 
133
+ Additional instructions: {instructions}
134
+
135
  Generate a revised "Red Team" document that addresses all issues found in the compliance report.
136
  Follow these guidelines:
137
+ 1. Use Wikipedia style writing with active voice. Be firm with the approach, no soft words like could be, may be, should, might. Use definitive language.
138
  2. For each requirement, describe in detail how MicroHealth will innovate to address it.
139
  3. Explain the industry best practices that will be applied and the workflow to accomplish the steps in the best practice to address the requirement.
140
  4. Provide measurable outcomes for the customer.
141
  5. Limit the use of bullet points and write predominantly in paragraph format.
142
  6. Ensure a logical flow of steps taken by MicroHealth for each requirement.
143
  7. Where applicable, describe the labor category or labor categories that perform the task as part of the process
144
+ 8. {instructions}
145
  """
146
  response = model.generate_content(prompt)
147
  return response.text
 
256
  dcc.Download(id="download-p-review-doc")
257
  ]),
258
  dbc.Tab(label="Red", tab_id="red", children=[
259
+ dbc.Textarea(
260
+ id='red-instructions',
261
+ placeholder="Enter any additional instructions for generating the Red Team document...",
262
+ style={'height': '100px', 'marginBottom': '10px'}
263
+ ),
264
  dcc.Upload(
265
  id='upload-red',
266
  children=html.Div(['Drag and Drop or ', html.A('Select Files')]),
 
450
  Input('generate-red', 'n_clicks'),
451
  State('upload-red', 'contents'),
452
  State('upload-red', 'filename'),
453
+ State('p-review-output', 'children'),
454
+ State('red-instructions', 'value')
455
  )
456
+ def update_red_output(n_clicks, contents, filename, p_review_output, instructions):
457
  if n_clicks is None:
458
  return "Click 'Generate Red Team Document' to begin."
459
 
 
464
  else:
465
  return "Please upload a document or complete the P.Review first."
466
 
467
+ red_doc = generate_red_document(document, p_review_output, instructions or "")
468
  return dcc.Markdown(red_doc)
469
 
470
  @app.callback(