from dataclasses import dataclass from typing import Protocol, runtime_checkable @dataclass(frozen=True) class SimilarArtist: mbid: str name: str score: float @runtime_checkable class SimilaritySource(Protocol): name: str def health(self) -> bool: """Is this source reachable right now?""" ... def similar_artists(self, mbid: str) -> list[SimilarArtist]: """Artists similar to the given artist MBID (MBID-native).""" ...