Skip to content

guidellm.benchmark.schemas.random

RandomArgs

Bases: PydanticClassRegistryMixin['RandomArgs'], ABC

Base class for random initialization arguments.

Attributes:

Name Type Description
schema_discriminator str

Field name for polymorphic deserialization

Source code in src/guidellm/benchmark/schemas/random.py
class RandomArgs(PydanticClassRegistryMixin["RandomArgs"], ABC):
    """Base class for random initialization arguments.

    :cvar schema_discriminator: Field name for polymorphic deserialization
    """

    model_config = standard_model_config()

    schema_discriminator: ClassVar[str] = "kind"

    @classmethod
    def __pydantic_schema_base_type__(cls) -> type[RandomArgs]:
        """
        Return base type for polymorphic validation hierarchy.

        :return: Base RandomArgs class for schema validation
        """
        if cls.__name__ == "RandomArgs":
            return cls

        return RandomArgs

    kind: str = Field(
        description="The kind of random configuration to use.",
    )

__pydantic_schema_base_type__() classmethod

Return base type for polymorphic validation hierarchy.

Returns:

Type Description
type[RandomArgs]

Base RandomArgs class for schema validation

Source code in src/guidellm/benchmark/schemas/random.py
@classmethod
def __pydantic_schema_base_type__(cls) -> type[RandomArgs]:
    """
    Return base type for polymorphic validation hierarchy.

    :return: Base RandomArgs class for schema validation
    """
    if cls.__name__ == "RandomArgs":
        return cls

    return RandomArgs