执行器
Executor
dataclass
Executor(
desc: str = "Evaluating",
show_progress: bool = True,
keep_progress_bar: bool = True,
jobs: List[Any] = list(),
raise_exceptions: bool = False,
run_config: Optional[RunConfig] = None,
_nest_asyncio_applied: bool = False,
)
Executor class for running asynchronous jobs with progress tracking and error handling.
Attributes:
Name | Type | Description |
---|---|---|
desc |
str
|
Description for the progress bar |
show_progress |
bool
|
Whether to show the progress bar |
keep_progress_bar |
bool
|
Whether to keep the progress bar after completion |
jobs |
List[Any]
|
List of jobs to execute |
raise_exceptions |
bool
|
Whether to raise exceptions or log them |
run_config |
RunConfig
|
Configuration for the run |
_nest_asyncio_applied |
bool
|
Whether nest_asyncio has been applied |
submit
Submit a job to be executed. This will wrap the callable with error handling and indexing to keep track of the job index.
Source code in src/ragas/executor.py
results
Execute all submitted jobs and return their results. The results are returned in the order of job submission.
Source code in src/ragas/executor.py
is_event_loop_running
Check if an event loop is currently running.
run_async_batch
A utility function to run the same async function with different arguments in parallel.