vikramvasudevan commited on
Commit
98834ab
·
verified ·
1 Parent(s): d5a96af

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. modules/nodes/init.py +13 -14
modules/nodes/init.py CHANGED
@@ -113,22 +113,21 @@ End with a short list of follow-up prompts:
113
  """
114
  ),
115
  ]
116
- state["initialized"] = True
117
-
118
- # Language enforcement + cleanup
119
- state["messages"].append(
120
- SystemMessage(
121
- content=(
122
- f"⚠️ IMPORTANT TRANSLATION RULE:\n"
123
- f"- The user’s preferred language is **{state['language']}**.\n"
124
- f"- You must translate **all sections, summaries, notes, and prompts** into {state['language']}.\n"
125
- f"- The ONLY exception: `📜 Original Verse(s)` and `📜 Sanitized Verse(s)` must stay in their native script.\n"
126
- f"- Section headings, `Next Steps`, explanatory notes, purports, WBW meanings, and follow-up questions must ALL be in {state['language']}.\n"
127
- f"- Ensure the translation is natural, grammatically correct, and free of spelling or orthographic errors.\n"
128
- f"- Never leave English fragments, untranslated words, or foreign characters unless they are proper names of scriptures or authors.\n"
129
  )
130
  )
131
- )
132
 
133
  state["tool_calls"] = 0
134
  state["seen_tool_calls"] = set()
 
113
  """
114
  ),
115
  ]
116
+ # Language enforcement + cleanup (it is done once only to reduce context size. accordingly, the session is reset whenever language changes.so this should be fine.)
117
+ state["messages"].append(
118
+ SystemMessage(
119
+ content=(
120
+ f"⚠️ IMPORTANT TRANSLATION RULE:\n"
121
+ f"- The user’s preferred language is **{state['language']}**.\n"
122
+ f"- You must translate **all sections, summaries, notes, and prompts** into {state['language']}.\n"
123
+ f"- The ONLY exception: `📜 Original Verse(s)` and `📜 Sanitized Verse(s)` must stay in their native script.\n"
124
+ f"- Section headings, `Next Steps`, explanatory notes, purports, WBW meanings, and follow-up questions must ALL be in {state['language']}.\n"
125
+ f"- Ensure the translation is natural, grammatically correct, and free of spelling or orthographic errors.\n"
126
+ f"- Never leave English fragments, untranslated words, or foreign characters unless they are proper names of scriptures or authors.\n"
127
+ )
 
128
  )
129
  )
130
+ state["initialized"] = True
131
 
132
  state["tool_calls"] = 0
133
  state["seen_tool_calls"] = set()