Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc PR Part 1] Necessary fixes for API reference generation #1976

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions dspy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,4 @@
configure = settings.configure
context = settings.context


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
BootstrapRS = BootstrapFewShotWithRandomSearch
7 changes: 7 additions & 0 deletions dspy/adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
2 changes: 1 addition & 1 deletion dspy/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def disable_litellm_logging():


__all__ = [
"BaseLM",
"LM",
"Provider",
"TrainingJob",
"BaseLM",
"inspect_history",
"Embedder",
"enable_litellm_logging",
Expand Down
10 changes: 10 additions & 0 deletions dspy/evaluate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
9 changes: 8 additions & 1 deletion dspy/experimental/synthesizer/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]
13 changes: 4 additions & 9 deletions dspy/experimental/synthesizer/synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand Down
4 changes: 1 addition & 3 deletions dspy/primitives/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = [
Expand All @@ -15,6 +15,4 @@
"Program",
"Module",
"PythonInterpreter",
"TextPrompt",
"CodePrompt",
]
2 changes: 0 additions & 2 deletions dspy/signatures/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
SignatureMeta,
Signature,
update_signatures,
ensure_signature,
make_signature,
infer_prefix,
)
Expand All @@ -18,6 +17,5 @@
"Signature",
"infer_prefix",
"update_signatures",
"ensure_signature",
"make_signature",
]
2 changes: 0 additions & 2 deletions dspy/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def download(url):


__all__ = [
"download",
"BaseCallback",
"with_callbacks",
"DummyLM",
"DummyVectorizer",
"dummy_rm",
Expand Down
Loading