Skip to content

RunConfig

RunConfig dataclass

RunConfig(
    timeout: int = 180,
    max_retries: int = 10,
    max_wait: int = 60,
    max_workers: int = 16,
    exception_types: Union[
        Type[BaseException], Tuple[Type[BaseException], ...]
    ] = (Exception,),
    log_tenacity: bool = False,
    seed: int = 42,
)

Configuration for timeouts, retries, concurrency and seed for Ragas operations.

Parameters:

Name Type Description Default
timeout int

Wall-clock limit (in seconds) on one job -- one metric scoring one row in metrics_experiment, or one testset-generation step -- covering all of its LLM calls, retries and backoff waits included. Not a per-request timeout; set that on the provider client. By default 180.

180
max_retries int

Maximum number of attempts per LLM call, by default 10.

10
max_wait int

Maximum wait time (in seconds) between attempts, by default 60.

60
max_workers int

Maximum number of concurrent workers, by default 16.

16
exception_types Union[Type[BaseException], Tuple[Type[BaseException], ...]]

Exception types to retry on, by default (Exception,). For the llm_factory LLMs the default means transient errors only (rate limits, timeouts, 5xx; never a 400); any other value retries exactly those types.

(Exception,)
log_tenacity bool

Whether to log retry attempts, by default False.

False
seed int

Random seed for reproducibility, by default 42.

42

Attributes:

Name Type Description
rng Generator

Random number generator initialized with the specified seed.

Notes

The __post_init__ method initializes the rng attribute as a numpy random number generator using the specified seed.