feat(discovery): SimilaritySource protocol + FakeSimilaritySource

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan
2026-07-12 00:03:45 +02:00
parent 0ddc9db611
commit 889e33355f
4 changed files with 53 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
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)."""
...