MCPcopy
hub / github.com/stanfordnlp/dspy / forward

Method forward

dspy/teleprompt/infer_rules.py:143–152  ·  view source on GitHub ↗
(self, examples_text)

Source from the content-addressed store, hash-verified

141 self.rng = random.Random(0)
142
143 def forward(self, examples_text):
144 with dspy.context(**self.teacher_settings):
145 # Generate rules with a fresh rollout and non-zero temperature.
146 lm = dspy.settings.lm.copy(
147 rollout_id=self.rng.randint(0, 10**9), temperature=1.0
148 )
149 with dspy.context(lm=lm):
150 rules = self.rules_induction(examples_text=examples_text).natural_language_rules
151
152 return rules.strip()

Callers

nothing calls this directly

Calls 2

contextMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected