diff --git a/dspy/__init__.py b/dspy/__init__.py index 49fb5f944f..f5283f30da 100644 --- a/dspy/__init__.py +++ b/dspy/__init__.py @@ -24,6 +24,8 @@ configure = settings.configure context = settings.context +BootstrapRS = BootstrapFewShotWithRandomSearch + from .__metadata__ import ( __name__, __version__, @@ -32,15 +34,3 @@ __author__, __author_email__ ) - -import dspy.teleprompt - -LabeledFewShot = dspy.teleprompt.LabeledFewShot -BootstrapFewShot = dspy.teleprompt.BootstrapFewShot -BootstrapFewShotWithRandomSearch = dspy.teleprompt.BootstrapFewShotWithRandomSearch -BootstrapRS = dspy.teleprompt.BootstrapFewShotWithRandomSearch -BootstrapFinetune = dspy.teleprompt.BootstrapFinetune -BetterTogether = dspy.teleprompt.BetterTogether -COPRO = dspy.teleprompt.COPRO -MIPROv2 = dspy.teleprompt.MIPROv2 -Ensemble = dspy.teleprompt.Ensemble diff --git a/dspy/adapters/__init__.py b/dspy/adapters/__init__.py index 5802bd58d4..e6358a27e2 100644 --- a/dspy/adapters/__init__.py +++ b/dspy/adapters/__init__.py @@ -2,3 +2,10 @@ from dspy.adapters.chat_adapter import ChatAdapter from dspy.adapters.json_adapter import JSONAdapter from dspy.adapters.image_utils import Image + +__all__ = [ + "Adapter", + "ChatAdapter", + "JSONAdapter", + "Image", +] diff --git a/dspy/clients/__init__.py b/dspy/clients/__init__.py index fbeec22e29..869c544d97 100644 --- a/dspy/clients/__init__.py +++ b/dspy/clients/__init__.py @@ -36,10 +36,10 @@ def disable_litellm_logging(): __all__ = [ + "BaseLM", "LM", "Provider", "TrainingJob", - "BaseLM", "inspect_history", "Embedder", "enable_litellm_logging", diff --git a/dspy/evaluate/__init__.py b/dspy/evaluate/__init__.py index c2336c3f9c..a4dd669aea 100644 --- a/dspy/evaluate/__init__.py +++ b/dspy/evaluate/__init__.py @@ -3,3 +3,13 @@ from dspy.evaluate.metrics import answer_exact_match, answer_passage_match from dspy.evaluate.evaluate import Evaluate from dspy.evaluate.auto_evaluation import SemanticF1, CompleteAndGrounded + +__all__ = [ + "EM", + "normalize_text", + "answer_exact_match", + "answer_passage_match", + "Evaluate", + "SemanticF1", + "CompleteAndGrounded", +] diff --git a/dspy/experimental/synthesizer/__init__.py b/dspy/experimental/synthesizer/__init__.py index 40f0c94f70..78f879c74b 100644 --- a/dspy/experimental/synthesizer/__init__.py +++ b/dspy/experimental/synthesizer/__init__.py @@ -1 +1,8 @@ -from dspy.experimental.synthesizer import * +from dspy.experimental.synthesizer.synthesizer import Synthesizer +from dspy.experimental.synthesizer.config import SynthesizerArguments + + +__all__ = [ + "Synthesizer", + "SynthesizerArguments", +] diff --git a/dspy/experimental/synthesizer/synthesizer.py b/dspy/experimental/synthesizer/synthesizer.py index 2fea0f85dd..9a2bfcd74c 100644 --- a/dspy/experimental/synthesizer/synthesizer.py +++ b/dspy/experimental/synthesizer/synthesizer.py @@ -7,13 +7,12 @@ from tqdm import tqdm, trange import dspy - -from .config import SynthesizerArguments -from .instruction_suffixes import ( +from dspy.experimental.synthesizer.config import SynthesizerArguments +from dspy.experimental.synthesizer.instruction_suffixes import ( INPUT_GENERATION_TASK_WITH_EXAMPLES_SUFFIX, INPUT_GENERATION_TASK_WITH_FEEDBACK_SUFFIX, ) -from .signatures import ( +from dspy.experimental.synthesizer.signatures import ( ExplainTask, GenerateFieldDescription, GenerateInputFieldsData, @@ -22,12 +21,8 @@ UnderstandTask, UpdateTaskDescriptionBasedOnFeedback, ) -from .utils import format_examples +from dspy.experimental.synthesizer.utils import format_examples -__all__ = [ - "Synthesizer", - "SynthesizerArguments", -] class Synthesizer: def __init__(self, config: SynthesizerArguments): diff --git a/dspy/primitives/__init__.py b/dspy/primitives/__init__.py index 655d9d67d6..21ee25be82 100644 --- a/dspy/primitives/__init__.py +++ b/dspy/primitives/__init__.py @@ -3,7 +3,7 @@ from dspy.primitives.module import BaseModule from dspy.primitives.prediction import Prediction, Completions from dspy.primitives.program import Program, Module -from dspy.primitives.python_interpreter import PythonInterpreter, TextPrompt, CodePrompt +from dspy.primitives.python_interpreter import PythonInterpreter __all__ = [ @@ -15,6 +15,4 @@ "Program", "Module", "PythonInterpreter", - "TextPrompt", - "CodePrompt", ] diff --git a/dspy/signatures/__init__.py b/dspy/signatures/__init__.py index b94fb579ff..3b902dbb5b 100644 --- a/dspy/signatures/__init__.py +++ b/dspy/signatures/__init__.py @@ -8,6 +8,7 @@ infer_prefix, ) + __all__ = [ "InputField", "OutputField",