(self, question: str)
| 62 | self.predict = dspy.Predict("question -> answer") |
| 63 | |
| 64 | def forward(self, question: str) -> str: |
| 65 | lm = dspy.LM("openai/gpt-4o-mini", cache=False) if "France" in question else dspy.settings.lm |
| 66 | with dspy.context(lm=lm): |
| 67 | time.sleep(1) |
| 68 | assert dspy.settings.lm.model == lm.model |
| 69 | return self.predict(question=question) |
| 70 | |
| 71 | with mock.patch("litellm.completion") as mock_completion: |
| 72 | mock_completion.return_value = ModelResponse( |