diff --git a/dspy/experimental/synthesizer/config.py b/dspy/experimental/synthesizer/config.py index 640989c22..557299cfa 100644 --- a/dspy/experimental/synthesizer/config.py +++ b/dspy/experimental/synthesizer/config.py @@ -1,6 +1,8 @@ -from typing import Optional, Any +from typing import Any, Optional + from pydantic import BaseModel, model_validator + class SynthesizerArguments(BaseModel): feedback_mode: Optional[str] = None num_example_for_feedback: Optional[int] = None diff --git a/dspy/experimental/synthesizer/synthesizer.py b/dspy/experimental/synthesizer/synthesizer.py index a3ffdcda8..ad71f9eee 100644 --- a/dspy/experimental/synthesizer/synthesizer.py +++ b/dspy/experimental/synthesizer/synthesizer.py @@ -1,11 +1,12 @@ -import dspy import random +from collections.abc import Mapping +from typing import List, Optional, Union from datasets import Dataset -from tqdm import tqdm, trange from rich import print as rprint -from collections.abc import Mapping -from typing import List, Optional, Union +from tqdm import tqdm, trange + +import dspy from .config import SynthesizerArguments from .instruction_suffixes import ( diff --git a/dspy/experimental/synthesizer/utils.py b/dspy/experimental/synthesizer/utils.py index b52ae9016..f08b142e1 100644 --- a/dspy/experimental/synthesizer/utils.py +++ b/dspy/experimental/synthesizer/utils.py @@ -1,6 +1,8 @@ -import dspy from typing import List +import dspy + + def format_examples(examples: List[dspy.Example]) -> str: if isinstance(examples, str): return examples