Skip to content

Commit d935b48

Browse files
committed
prompt
1 parent 58ce5a7 commit d935b48

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ def extract_bank_statement_hybrid(text, transactions_payload=None, save_json_pat
583583
response = client.chat.completions.create(
584584
model="gpt-4o",
585585
messages=[
586-
{"role": "system", "content": "You are a financial analyst expert at extracting structured data from bank statements. Return valid JSON only."},
586+
{"role": "system", "content": "You are a financial analyst expert at extracting structured data from Indian bank statements. All monetary values are in Indian Rupees (INR). Return valid JSON only."},
587587
{"role": "user", "content": llm_prompt}
588588
],
589589
response_format={"type": "json_object"},
@@ -744,7 +744,7 @@ def extract_itr_hybrid(text):
744744
response = client.chat.completions.create(
745745
model="gpt-4o",
746746
messages=[
747-
{"role": "system", "content": "You are a tax expert analyzing ITR documents. Extract all financial data accurately. Return valid JSON only."},
747+
{"role": "system", "content": "You are a tax expert analyzing Indian ITR documents. All monetary values are in Indian Rupees (INR). Extract all financial data accurately. Return valid JSON only."},
748748
{"role": "user", "content": llm_prompt}
749749
],
750750
response_format={"type": "json_object"},
@@ -935,7 +935,7 @@ def extract_insurance_hybrid(text):
935935
response = client.chat.completions.create(
936936
model="gpt-4o",
937937
messages=[
938-
{"role": "system", "content": "You are an insurance expert analyzing insurance policies. Extract all details accurately based on the insurance type. Return valid JSON only."},
938+
{"role": "system", "content": "You are an insurance expert analyzing Indian insurance policies. All monetary values are in Indian Rupees (INR). Extract all details accurately based on the insurance type. Return valid JSON only."},
939939
{"role": "user", "content": llm_prompt}
940940
],
941941
response_format={"type": "json_object"},
@@ -1028,7 +1028,7 @@ def extract_mutual_fund_cas_hybrid(text):
10281028
response = client.chat.completions.create(
10291029
model="gpt-4o",
10301030
messages=[
1031-
{"role": "system", "content": "You are a mutual fund analysis expert. Extract structured data into a valid JSON format."},
1031+
{"role": "system", "content": "You are a mutual fund analysis expert for Indian markets. All monetary values are in Indian Rupees (INR). Extract structured data into a valid JSON format."},
10321032
{"role": "user", "content": llm_prompt}
10331033
],
10341034
response_format={"type": "json_object"},

llm_sections.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ def digest(self, facts: Dict[str, Any]) -> Dict[str, Any]:
384384
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
385385
system = (
386386
"You are a senior financial planner writing for Indian retail clients. "
387+
"IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency. "
387388
"Be precise, neutral, and practical. No guarantees or forward-looking promises. "
388389
"Return valid JSON with keys: title (string), bullets (array of short points), paragraphs (2-3 short paragraphs), actions (checklist items)."
389390
)
@@ -420,6 +421,7 @@ def digest(self, facts: Dict[str, Any]) -> Dict[str, Any]:
420421
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
421422
system = (
422423
"You are a senior financial planner. Draft a protection (life/health) section for Indian clients. "
424+
"IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency. "
423425
"No guarantees; avoid product pushing; focus on adequacy and prioritization."
424426
)
425427
user = (
@@ -448,7 +450,8 @@ def digest(self, facts: Dict[str, Any]) -> Dict[str, Any]:
448450

449451
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
450452
system = (
451-
"You are a financial planner. Explain cashflows clearly, with practical advice to improve savings."
453+
"You are a financial planner for Indian clients. Explain cashflows clearly, with practical advice to improve savings. "
454+
"IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency."
452455
)
453456
user = (
454457
"Section: Cashflow Overview\n"
@@ -473,7 +476,7 @@ def digest(self, facts: Dict[str, Any]) -> Dict[str, Any]:
473476
}
474477

475478
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
476-
system = "You craft debt optimization advice for Indian retail clients. Be specific and conservative."
479+
system = "You craft debt optimization advice for Indian retail clients. Be specific and conservative. IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency."
477480
user = (
478481
"Section: Debt Strategy\n"
479482
f"FactsDigest:\n{_json_dumps(digest)}\n\n"
@@ -494,7 +497,7 @@ def digest(self, facts: Dict[str, Any]) -> Dict[str, Any]:
494497
}
495498

496499
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
497-
system = "You design emergency fund guidance aligned with Indian norms (6+ months as baseline)."
500+
system = "You design emergency fund guidance aligned with Indian norms (6+ months as baseline). IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency."
498501
user = (
499502
"Section: Liquidity Plan\n"
500503
f"FactsDigest:\n{_json_dumps(digest)}\n\n"
@@ -518,7 +521,7 @@ def digest(self, facts: Dict[str, Any]) -> Dict[str, Any]:
518521
}
519522

520523
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
521-
system = "You explain risk profile and asset allocation rationale simply and accurately."
524+
system = "You explain risk profile and asset allocation rationale for Indian clients simply and accurately. IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency."
522525
user = (
523526
"Section: Risk Profile & Allocation Rationale\n"
524527
f"FactsDigest:\n{_json_dumps(digest)}\n\n"
@@ -649,6 +652,7 @@ def digest(self, facts: Dict[str, Any]) -> Dict[str, Any]:
649652
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
650653
system = (
651654
"You are a senior financial planner creating realistic goal strategies for Indian retail clients. "
655+
"IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency. "
652656
"Your role is to provide HONEST and PRACTICAL advice. "
653657
"For each goal, compare the IDEAL SIP (what's mathematically needed to achieve the goal) against "
654658
"what's actually AFFORDABLE given the client's income and existing commitments. "
@@ -697,8 +701,9 @@ def digest(self, facts: Dict[str, Any]) -> Optional[Dict[str, Any]]:
697701

698702
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
699703
system = (
700-
"You suggest high-level rebalancing directions without naming products. "
701-
"IMPORTANT: Be consistent with the client's risk profile. "
704+
"You suggest high-level rebalancing directions for Indian clients without naming products. "
705+
"IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency. "
706+
"Be consistent with the client's risk profile. "
702707
"If portfolio equity is already above the recommended band, suggest reducing equity exposure. "
703708
"If portfolio equity is below the recommended band, suggest increasing equity exposure. "
704709
"Never give advice that contradicts the risk profile recommendations."
@@ -740,7 +745,7 @@ def _small(sec):
740745
}
741746

742747
def prompt(self, digest: Dict[str, Any]) -> Tuple[str, str]:
743-
system = "You write a crisp executive summary for Indian retail clients."
748+
system = "You write a crisp executive summary for Indian retail clients. IMPORTANT: All monetary values MUST be in Indian Rupees (₹ or Rs.). NEVER use dollars ($) or any other currency."
744749
user = (
745750
"Section: Executive Summary\n"
746751
"You are given short outlines from multiple sections. Create a concise summary.\n"

0 commit comments

Comments
 (0)