Spaces:
Sleeping
Sleeping
Commit
·
efbe684
1
Parent(s):
594251f
Upd direct file identifier in app.py
Browse files
app.py
CHANGED
|
@@ -678,7 +678,7 @@ async def generate_report(
|
|
| 678 |
).format(max(100, outline_words))
|
| 679 |
|
| 680 |
instruction_context = f"USER_REQUEST: {instructions}\n\n" if instructions.strip() else ""
|
| 681 |
-
user_outline = f"{instruction_context}MATERIALS:\n\n[FILE_SUMMARY]\n{file_summary}\n\n[DOC_CONTEXT]\n{context_text}"
|
| 682 |
|
| 683 |
try:
|
| 684 |
# Step 1: Outline with Flash/Med
|
|
@@ -696,12 +696,12 @@ async def generate_report(
|
|
| 696 |
"- Structure the report to answer exactly what the user asked for\n"
|
| 697 |
"- Use clear section headings\n"
|
| 698 |
"- Keep content factual and grounded in the provided materials\n"
|
| 699 |
-
"- Include brief citations like (source:
|
| 700 |
"- If the user asked for a specific section/topic, focus heavily on that\n"
|
| 701 |
f"- Target length ~{max(600, report_words)} words\n"
|
| 702 |
"- Ensure the report directly fulfills the user's request"
|
| 703 |
)
|
| 704 |
-
user_report = f"{instruction_focus}OUTLINE:\n{outline_md}\n\nMATERIALS:\n[FILE_SUMMARY]\n{file_summary}\n\n[DOC_CONTEXT]\n{context_text}"
|
| 705 |
|
| 706 |
try:
|
| 707 |
selection_report = {"provider": "gemini", "model": os.getenv("GEMINI_PRO", "gemini-2.5-pro")}
|
|
@@ -940,7 +940,8 @@ async def _chat_impl(
|
|
| 940 |
system_prompt = (
|
| 941 |
"You are a careful study assistant. Answer strictly using the given CONTEXT.\n"
|
| 942 |
"If the answer isn't in the context, say 'I don't know based on the provided materials.'\n"
|
| 943 |
-
"Write concise, clear explanations with citations like (source:
|
|
|
|
| 944 |
)
|
| 945 |
|
| 946 |
# Add recent chat context and historical similarity context
|
|
|
|
| 678 |
).format(max(100, outline_words))
|
| 679 |
|
| 680 |
instruction_context = f"USER_REQUEST: {instructions}\n\n" if instructions.strip() else ""
|
| 681 |
+
user_outline = f"{instruction_context}MATERIALS:\n\n[FILE_SUMMARY from {eff_name}]\n{file_summary}\n\n[DOC_CONTEXT]\n{context_text}"
|
| 682 |
|
| 683 |
try:
|
| 684 |
# Step 1: Outline with Flash/Med
|
|
|
|
| 696 |
"- Structure the report to answer exactly what the user asked for\n"
|
| 697 |
"- Use clear section headings\n"
|
| 698 |
"- Keep content factual and grounded in the provided materials\n"
|
| 699 |
+
f"- Include brief citations like (source: {eff_name}, topic) - use the actual filename provided\n"
|
| 700 |
"- If the user asked for a specific section/topic, focus heavily on that\n"
|
| 701 |
f"- Target length ~{max(600, report_words)} words\n"
|
| 702 |
"- Ensure the report directly fulfills the user's request"
|
| 703 |
)
|
| 704 |
+
user_report = f"{instruction_focus}OUTLINE:\n{outline_md}\n\nMATERIALS:\n[FILE_SUMMARY from {eff_name}]\n{file_summary}\n\n[DOC_CONTEXT]\n{context_text}"
|
| 705 |
|
| 706 |
try:
|
| 707 |
selection_report = {"provider": "gemini", "model": os.getenv("GEMINI_PRO", "gemini-2.5-pro")}
|
|
|
|
| 940 |
system_prompt = (
|
| 941 |
"You are a careful study assistant. Answer strictly using the given CONTEXT.\n"
|
| 942 |
"If the answer isn't in the context, say 'I don't know based on the provided materials.'\n"
|
| 943 |
+
"Write concise, clear explanations with citations like (source: actual_filename, topic).\n"
|
| 944 |
+
"Use the exact filename as provided in the context, not placeholders.\n"
|
| 945 |
)
|
| 946 |
|
| 947 |
# Add recent chat context and historical similarity context
|