sofhiaazzhr commited on
Commit
ca3f670
·
1 Parent(s): 3e1772d

[NOTICKET] fix(agents): soften injected reply-language line to a default, not ONLY

Browse files

The [Reply language] value was injected as 'Respond ONLY in: X', which fought the system prompt's 'default + explicit-request exception' rule and could make the model ignore an explicit 'jawab dalam bahasa Inggris'. Inject just the detected value; the rule (and the override exception) lives in chatbot_system.md.

Files changed (1) hide show
  1. src/agents/chatbot.py +3 -3
src/agents/chatbot.py CHANGED
@@ -127,9 +127,9 @@ def _build_default_chain() -> Runnable:
127
  prompt = ChatPromptTemplate.from_messages(
128
  [
129
  ("system", _load_system_prompt()),
130
- # Hard reply-language directive — the system prompt's language rule
131
- # points at this. Deterministic + mandatory, mirrors the help path.
132
- ("system", "[Reply language]\nRespond ONLY in: {reply_language}"),
133
  MessagesPlaceholder(variable_name="history", optional=True),
134
  ("human", "{message}"),
135
  ("system", "Data context for this turn:\n\n{context}"),
 
127
  prompt = ChatPromptTemplate.from_messages(
128
  [
129
  ("system", _load_system_prompt()),
130
+ # Detected default reply language — the system prompt's reply-language
131
+ # rule reads this value (and defines the explicit-request exception).
132
+ ("system", "[Reply language] (detected default): {reply_language}"),
133
  MessagesPlaceholder(variable_name="history", optional=True),
134
  ("human", "{message}"),
135
  ("system", "Data context for this turn:\n\n{context}"),