Spaces:
Building
Building
Upload folder using huggingface_hub
Browse files- 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 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 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()
|