@@ -19,7 +19,7 @@ def __init__(self, llm=None):
1919 # self,
2020 # treatment: str,
2121 # outcome: str,
22- # factors_list : list(),
22+ # all_factors : list(),
2323 # llm: guidance.models,
2424 # backdoor: Set[str] = None,
2525 # frontdoor: Set[str] = None,
@@ -41,7 +41,7 @@ def __init__(self, llm=None):
4141 # backdoor_edges, backdoor_set = self.suggest_backdoor(
4242 # treatment=treatment,
4343 # outcome=outcome,
44- # factors_list=factors_list ,
44+ # all_factors=all_factors ,
4545 # llm=llm,
4646 # experts=experts,
4747 # analysis_context=analysis_context,
@@ -66,7 +66,7 @@ def __init__(self, llm=None):
6666 # frontdoor_edges, frontdoor_set = self.suggest_frontdoor(
6767 # treatment=treatment,
6868 # outcome=outcome,
69- # factors_list=factors_list ,
69+ # all_factors=all_factors ,
7070 # llm=llm,
7171 # experts=experts,
7272 # analysis_context=analysis_context,
@@ -87,7 +87,7 @@ def __init__(self, llm=None):
8787 # ivs_edges, ivs_set = self.suggest_ivs(
8888 # treatment=treatment,
8989 # outcome=outcome,
90- # factors_list=factors_list ,
90+ # all_factors=all_factors ,
9191 # llm=llm,
9292 # experts=experts,
9393 # analysis_context=analysis_context,
@@ -116,15 +116,15 @@ def suggest_backdoor(
116116 self ,
117117 treatment : str ,
118118 outcome : str ,
119- factors_list : list (),
119+ all_factors : list (),
120120 expertise_list : list (),
121- analysis_context = CONTEXT ,
121+ analysis_context : str = CONTEXT ,
122122 stakeholders : list () = None
123123 ):
124124 backdoor_set = self .model_suggester .suggest_confounders (
125125 treatment = treatment ,
126126 outcome = outcome ,
127- factors_list = factors_list ,
127+ all_factors = all_factors ,
128128 expertise_list = expertise_list ,
129129 analysis_context = analysis_context ,
130130 stakeholders = stakeholders
@@ -136,9 +136,9 @@ def suggest_frontdoor(
136136 self ,
137137 treatment : str ,
138138 outcome : str ,
139- factors_list : list (),
139+ all_factors : list (),
140140 expertise_list : list (),
141- analysis_context = CONTEXT ,
141+ analysis_context : str = CONTEXT ,
142142 stakeholders : list () = None
143143 ):
144144 pass
@@ -147,9 +147,9 @@ def suggest_mediators(
147147 self ,
148148 treatment : str ,
149149 outcome : str ,
150- factors_list : list (),
150+ all_factors : list (),
151151 expertise_list : list (),
152- analysis_context = CONTEXT ,
152+ analysis_context : str = CONTEXT ,
153153 stakeholders : list () = None
154154 ):
155155 expert_list : List [str ] = list ()
@@ -164,16 +164,16 @@ def suggest_mediators(
164164 mediators_edges [(treatment , outcome )] = 1
165165
166166 edited_factors_list : List [str ] = []
167- for i in range (len (factors_list )):
168- if factors_list [i ] != treatment and factors_list [i ] != outcome :
169- edited_factors_list .append (factors_list [i ])
167+ for i in range (len (all_factors )):
168+ if all_factors [i ] != treatment and all_factors [i ] != outcome :
169+ edited_factors_list .append (all_factors [i ])
170170
171171 for expert in expert_list :
172172 mediators_edges , mediators_list = self .request_mediators (
173173 treatment = treatment ,
174174 outcome = outcome ,
175175 domain_expertise = expert ,
176- factors_list = edited_factors_list ,
176+ all_factors = edited_factors_list ,
177177 mediators_edges = mediators_edges ,
178178 analysis_context = analysis_context
179179 )
@@ -187,9 +187,9 @@ def request_mediators(
187187 treatment ,
188188 outcome ,
189189 domain_expertise ,
190- factors_list ,
190+ all_factors ,
191191 mediators_edges ,
192- analysis_context = CONTEXT
192+ analysis_context : str = CONTEXT
193193 ):
194194 mediators : List [str ] = list ()
195195
@@ -218,7 +218,7 @@ def request_mediators(
218218 on the causal chain that links the { treatment } to the { outcome } ? From your perspective as an expert in
219219 { domain_expertise } , which factor(s) of the following factors, if any at all, mediates, is/are on the causal
220220 chain, that links the { treatment } to the { outcome } ? Then provide your step by step chain of thoughts within
221- the tags <thinking></thinking>. factor_names : { factors_list } Wrap the name of the factor(s), if any at all,
221+ the tags <thinking></thinking>. factor_names : { all_factors } Wrap the name of the factor(s), if any at all,
222222 that has/have a high likelihood of directly influencing and causing the assignment of the { outcome } and also
223223 has/have a high likelihood of being directly influenced and caused by the assignment of the { treatment } within
224224 the tags <mediating_factor>factor_name</mediating_factor>. Where factor_name is one of the items within the
@@ -237,7 +237,7 @@ def request_mediators(
237237 if mediating_factor :
238238 for factor in mediating_factor :
239239 # to not add it twice into the list
240- if factor in factors_list and factor not in mediators :
240+ if factor in all_factors and factor not in mediators :
241241 mediators .append (factor )
242242 success = True
243243
@@ -262,9 +262,9 @@ def suggest_ivs(
262262 self ,
263263 treatment : str ,
264264 outcome : str ,
265- factors_list : list (),
265+ all_factors : list (),
266266 expertise_list : list (),
267- analysis_context = CONTEXT ,
267+ analysis_context : str = CONTEXT ,
268268 stakeholders : list () = None
269269 ):
270270 expert_list : List [str ] = list ()
@@ -279,17 +279,17 @@ def suggest_ivs(
279279 iv_edges [(treatment , outcome )] = 1
280280
281281 edited_factors_list : List [str ] = []
282- for i in range (len (factors_list )):
283- if factors_list [i ] != treatment and factors_list [i ] != outcome :
284- edited_factors_list .append (factors_list [i ])
282+ for i in range (len (all_factors )):
283+ if all_factors [i ] != treatment and all_factors [i ] != outcome :
284+ edited_factors_list .append (all_factors [i ])
285285
286286 for expert in expert_list :
287287 iv_edges , iv_list = self .request_ivs (
288288 treatment = treatment ,
289289 outcome = outcome ,
290290 analysis_context = analysis_context ,
291291 domain_expertise = expert ,
292- factors_list = edited_factors_list ,
292+ all_factors = edited_factors_list ,
293293 iv_edges = iv_edges ,
294294 )
295295
@@ -305,7 +305,7 @@ def request_ivs(
305305 outcome ,
306306 analysis_context ,
307307 domain_expertise ,
308- factors_list ,
308+ all_factors ,
309309 iv_edges
310310 ):
311311 ivs : List [str ] = list ()
@@ -338,7 +338,7 @@ def request_ivs(
338338 the { outcome } ? Which factor(s) of the following factors, if any at all, are (an) instrumental variable(s)
339339 to the causal relationship of the { treatment } causing the { outcome } ? Be concise and keep your thinking
340340 within two paragraphs. Then provide your step by step chain of thoughts within the tags
341- <thinking></thinking>. factor_names : { factors_list } Wrap the name of the factor(s), if there are any at
341+ <thinking></thinking>. factor_names : { all_factors } Wrap the name of the factor(s), if there are any at
342342 all, that both has/have a high likelihood of influecing and causing the { treatment } and has/have a very low
343343 likelihood of influencing and causing the { outcome } , within the tags <iv_factor>factor_name</iv_factor>.
344344 Where factor_name is one of the items within the factor_names list. If a factor does not have a high
@@ -353,7 +353,7 @@ def request_ivs(
353353
354354 if iv_factors :
355355 for factor in iv_factors :
356- if factor in factors_list and factor not in ivs :
356+ if factor in all_factors and factor not in ivs :
357357 ivs .append (factor )
358358 success = True
359359
0 commit comments