55from guidance import system , user , assistant , gen
66from ..helpers import RelationshipStrategy
77import re
8- import inspect
8+ from inspect import cleandoc
99
1010class ModelSuggester (ModelerProtocol ):
1111 CONTEXT : str = """causal mechanisms"""
@@ -39,7 +39,7 @@ def suggest_domain_expertises(
3939 such factors? Think about this in a step by step manner and recommend { n_experts } expertises and
4040 provide each one wrapped within the tags, <domain_expertise></domain_expertise>, along with the
4141 reasoning and explanation wrapped between the tags <explanation></explanation>."""
42- lm += inspect . cleandoc (prompt_str )
42+ lm += cleandoc (prompt_str )
4343 with assistant ():
4444 lm += gen ("output" )
4545
@@ -82,7 +82,7 @@ def suggest_domain_experts(
8282 about this in a step by step manner and recommend { n_experts } domain experts and provide each one
8383 wrapped within the tags, <domain_expert></domain_expert>, along with the reasoning and explanation
8484 wrapped between the tags <explanation></explanation>."""
85- lm += inspect . cleandoc (prompt_str )
85+ lm += cleandoc (prompt_str )
8686 with assistant ():
8787 lm += gen ("output" )
8888
@@ -126,7 +126,7 @@ def suggest_stakeholders(
126126 this in a step by step manner and recommend { n_stakeholders } stakeholders. Then provide each useful stakeholder
127127 wrapped within the tags, <stakeholder></stakeholder>, along with the reasoning and explanation wrapped between the tags
128128 <explanation></explanation>."""
129- lm += inspect . cleandoc (prompt_str )
129+ lm += cleandoc (prompt_str )
130130 with assistant ():
131131 lm += gen ("output" )
132132
@@ -212,7 +212,7 @@ def request_confounders(
212212 analysis_context } . Where a causal model is a conceptual model that describes the causal mechanisms of a
213213 system. You
214214 will do this by answering questions about cause and effect and using your domain knowledge in { domain_expertise } ."""
215- lm += inspect . cleandoc (prompt_str )
215+ lm += cleandoc (prompt_str )
216216 with user ():
217217 prompt_str = f"""Follow the next two steps, and complete the first one before moving on to the second: (1)
218218 From your perspective as an
@@ -234,7 +234,7 @@ def request_confounders(
234234 <confounding_factor>factor_name</confounding_factor> where
235235 factor_name is one of the items within the factor_names list. If a factor does not have a high likelihood of directly
236236 confounding, then do not wrap the factor with any tags."""
237- lm += inspect . cleandoc (prompt_str )
237+ lm += cleandoc (prompt_str )
238238 with assistant ():
239239 lm += gen ("output" )
240240
@@ -311,7 +311,7 @@ def suggest_parents(
311311{ factor } ,
312312 then do not wrap the factor with any tags. Your answer as an expert in
313313{ domain_expertise } :"""
314- lm += inspect . cleandoc (prompt_str )
314+ lm += cleandoc (prompt_str )
315315
316316 with assistant ():
317317 lm += gen ("output" )
@@ -383,7 +383,7 @@ def suggest_children(
383383 factor_names list. If a factor does not have a high likelihood of directly influencing and causing the {
384384 factor } , then do not wrap the factor with any tags. Your answer as an expert in
385385 { domain_expertise } :"""
386- lm += inspect . cleandoc (prompt_str )
386+ lm += cleandoc (prompt_str )
387387 with assistant ():
388388 lm += gen ("output" )
389389
@@ -424,7 +424,7 @@ def suggest_pairwise_relationship(
424424 mechanisms of a system. You will do this by by answering questions about cause and effect and using your
425425 domain
426426 knowledge as an expert in { domain_expertise } ."""
427- lm += inspect . cleandoc (prompt_str )
427+ lm += cleandoc (prompt_str )
428428 with user ():
429429 prompt_str = f"""From your perspective as an expert in { domain_expertise } , which of the following is
430430 most likely true? (A) { factor_a } affects { factor_b } ; { factor_a } has a high likelihood of directly
@@ -436,7 +436,7 @@ def suggest_pairwise_relationship(
436436 you reach a conclusion, wrap your answer within the tags <answer></answer>. If you are done thinking, provide your
437437 answer wrapped within the tags <answer></answer>. e.g. <answer>A</answer>, <answer>B</answer>, or <answer>C</answer>.
438438 Your answer as an expert in { domain_expertise } :"""
439- lm += inspect . cleandoc (prompt_str )
439+ lm += cleandoc (prompt_str )
440440
441441 with assistant ():
442442 lm += gen ("output" )
0 commit comments