TahaFawzyElshrif commited on
Commit
774855e
·
1 Parent(s): 116d809

fixed comments

Browse files
Files changed (1) hide show
  1. agent/agent_graph/Graph_Nodes.py +6 -7
agent/agent_graph/Graph_Nodes.py CHANGED
@@ -42,15 +42,14 @@ def update_context(state:ProblemState):
42
 
43
  for i in list(keys):
44
 
45
- # 1️⃣ استبعاد المفاتيح غير القابلة للتعديل نهائيًا
46
  if i in ["question", "answer", "node_output_article", "memory"]:
47
  continue
48
 
49
- # 2️⃣ منع تعديل question_type بعد بداية الشات
50
- # - question_type يُسمح به فقط في أول الشات
51
- # - لو موجود بالفعل في state → يبقى الشات بدأممنوع التعديل
52
- # if exist question in data rag skip it
53
-
54
  if i == "question_type":
55
  if "question_type" in state.keys():
56
  continue
@@ -62,7 +61,7 @@ def update_context(state:ProblemState):
62
  _rag_text_if_exist = rag_text # store text to prevent calling twice
63
  continue
64
 
65
- # 3️⃣ أي key وصل هنا يبقى مسموح للـ LLM يرجّعه
66
  keys_modifiable.append(i)
67
 
68
  # Make the prompt
 
42
 
43
  for i in list(keys):
44
 
45
+ # 2️⃣ Prevent modifying question_type after chat starts
46
  if i in ["question", "answer", "node_output_article", "memory"]:
47
  continue
48
 
49
+ # 2️⃣ Prevent modifying question_type after chat starts
50
+ # - question_type is only allowed at the very start of the chat
51
+ # - If it already exists in state → chat has startedmodification not allowed
52
+ # if question exists in rag data skip it
 
53
  if i == "question_type":
54
  if "question_type" in state.keys():
55
  continue
 
61
  _rag_text_if_exist = rag_text # store text to prevent calling twice
62
  continue
63
 
64
+ # 3️⃣ Any key that reaches here is allowed to be returned by the LLM
65
  keys_modifiable.append(i)
66
 
67
  # Make the prompt