def settings_provider_factory(
msg: Union["ConsumerRecord", Sequence["ConsumerRecord"], None],
) -> Union[
KafkaMetricsSettingsProvider,
BatchKafkaMetricsSettingsProvider,
]:
if isinstance(msg, Sequence):
return BatchKafkaMetricsSettingsProvider()
else:
return KafkaMetricsSettingsProvider()