889e33355f
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
23 lines
483 B
Python
23 lines
483 B
Python
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)."""
|
|
...
|