Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -335,10 +335,10 @@ def fine_tune_report(adjustment_request: str, openai_api_key: str, serpapi_api_k
|
|
| 335 |
logging.info("fine_tune_report: Fine-tuning process completed.")
|
| 336 |
return updated_report_html, updated_qa
|
| 337 |
|
| 338 |
-
def suggest_improvements(report_html: str) -> str:
|
| 339 |
-
""
|
| 340 |
-
|
| 341 |
-
|
| 342 |
prompt = (
|
| 343 |
"You are a technical editor. Based on the following full HTML report, generate exactly 10 proposed improvement suggestions. "
|
| 344 |
"Format each proposal as a numbered list item in the following style:\n"
|
|
@@ -2953,7 +2953,7 @@ def main():
|
|
| 2953 |
|
| 2954 |
suggest_improvements_button.click(
|
| 2955 |
fn=suggest_improvements,
|
| 2956 |
-
inputs=[final_report],
|
| 2957 |
outputs=[adjustmentguidelines]
|
| 2958 |
)
|
| 2959 |
|
|
|
|
| 335 |
logging.info("fine_tune_report: Fine-tuning process completed.")
|
| 336 |
return updated_report_html, updated_qa
|
| 337 |
|
| 338 |
+
def suggest_improvements(report_html: str, openai_api_key: str, serpapi_api_key: str) -> str:
|
| 339 |
+
os.environ["OPENAI_API_KEY"] = openai_api_key
|
| 340 |
+
os.environ["SERPAPI_API_KEY"] = serpapi_api_key
|
| 341 |
+
|
| 342 |
prompt = (
|
| 343 |
"You are a technical editor. Based on the following full HTML report, generate exactly 10 proposed improvement suggestions. "
|
| 344 |
"Format each proposal as a numbered list item in the following style:\n"
|
|
|
|
| 2953 |
|
| 2954 |
suggest_improvements_button.click(
|
| 2955 |
fn=suggest_improvements,
|
| 2956 |
+
inputs=[final_report, openai_api_key_input, serpapi_api_key_input],
|
| 2957 |
outputs=[adjustmentguidelines]
|
| 2958 |
)
|
| 2959 |
|