dspy.Module
dspy.Module(callbacks=None)
Bases: BaseModule
Source code in dspy/primitives/program.py
Functions
__call__(*args, **kwargs)
batch(examples, num_threads: int = 32, max_errors: int = 10, return_failed_examples: bool = False, provide_traceback: bool = False, disable_progress_bar: bool = False)
Processes a list of dspy.Example instances in parallel using the Parallel module.
:param examples: List of dspy.Example instances to process. :param batch_size: Number of threads to use for parallel processing. :param max_errors: Maximum number of errors allowed before stopping execution. :param return_failed_examples: Whether to return failed examples and exceptions. :param provide_traceback: Whether to include traceback information in error logs. :return: List of results, and optionally failed examples and exceptions.