Shivam4096 commited on
Commit
3d42e7b
Β·
verified Β·
1 Parent(s): 8383751

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. pipeline/analyst.py +14 -1
pipeline/analyst.py CHANGED
@@ -203,6 +203,19 @@ Guidelines:
203
  - Numbers should be expressed in appropriate units (Cr for large INR amounts, B/M for USD)
204
  """
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  # ── Section prompts ───────────────────────────────────────────────────────────
207
 
208
  SECTION_PROMPTS = {
@@ -598,7 +611,7 @@ def generate_narrative(
598
  log(f" > Synthesizing {len(drafts)} drafts using {name}...")
599
 
600
  draft_text = "\n\n".join([f"--- Draft from {agent} ---\n{text}" for agent, text in drafts.items()])
601
- prompt = SYNTHESIS_PROMPT.format(section=section) + "\n\n" + draft_text
602
 
603
  # We reuse the context parameter to pass the prompt, and bypass the section wrapping by mocking it
604
  # Actually, let's just create a custom direct call for synthesis to avoid section wrapping issues.
 
203
  - Numbers should be expressed in appropriate units (Cr for large INR amounts, B/M for USD)
204
  """
205
 
206
+ # ── Synthesis Prompt ──────────────────────────────────────────────────────────
207
+
208
+ SYNTHESIS_PROMPT = """You are a master financial editor. You have been given {num_drafts} different AI-generated drafts for the '{section}' section of a financial report.
209
+ Your job is to synthesize these drafts into a single, cohesive, authoritative, and brilliantly written section.
210
+
211
+ Guidelines:
212
+ - Combine the best insights and data points from all drafts.
213
+ - Resolve any contradictions by taking the most logical or well-supported viewpoint.
214
+ - Write in a professional, direct, and opinionated financial analyst tone.
215
+ - Do NOT mention that this is a synthesis of multiple drafts or AI models.
216
+ - Output ONLY the final synthesized text, with NO markdown formatting, NO introductory text, and NO commentary. Just the plain text paragraphs.
217
+ """
218
+
219
  # ── Section prompts ───────────────────────────────────────────────────────────
220
 
221
  SECTION_PROMPTS = {
 
611
  log(f" > Synthesizing {len(drafts)} drafts using {name}...")
612
 
613
  draft_text = "\n\n".join([f"--- Draft from {agent} ---\n{text}" for agent, text in drafts.items()])
614
+ prompt = SYNTHESIS_PROMPT.format(section=section, num_drafts=len(drafts)) + "\n\n" + draft_text
615
 
616
  # We reuse the context parameter to pass the prompt, and bypass the section wrapping by mocking it
617
  # Actually, let's just create a custom direct call for synthesis to avoid section wrapping issues.