DSPy: The framework for programming—not prompting—language models
Python
Move error message inside set_lm in program.py
Dilara Soylu2f30cb857f60
diff --git a/dspy/primitives/program.py b/dspy/primitives/program.pyindex afbeabcbc..29af6130c 100644--- a/dspy/primitives/program.py+++ b/dspy/primitives/program.py@@ -9,9 +9,6 @@ from dspy.primitives.module import BaseModuleclass ProgramMeta(type):pass-EXPERIMENTAL_ERR_MSG = """Setting or getting the LM of a program is an\-experimental feature. Please enable the 'dspy.settings.experimental' flag\-to use these features."""class Module(BaseModule, metaclass=ProgramMeta):def _base_init(self):@@ -36,7 +33,7 @@ class Module(BaseModule, metaclass=ProgramMeta):AssertionError: If the dspy experimental setting is not enabled."""# Check if the experimental setting is enabled- err_msg = EXPERIMENTAL_ERR_MSG+ err_msg = "Setting or getting the LM of a program is an experimental feature. Please enable the 'dspy.settings.experimental' flag to use these features."assert dspy.settings.experimental, err_msg# Set the LM for all predictors