- Fix circular dependencies in agent/tools - Migrate from custom JSON to OpenAI tool calls format - Add async streaming (step_stream, complete_stream) - Simplify prompt system and remove token counting - Add 5 new API endpoints (/health, /v1/models, /api/memory/*) - Add 3 new tools (get_torrent_by_index, add_torrent_by_index, set_language) - Fix all 500 tests and add coverage config (80% threshold) - Add comprehensive docs (README, pytest guide) BREAKING: LLM interface changed, memory injection via get_memory()
74 lines
1.5 KiB
Python
74 lines
1.5 KiB
Python
"""Movie repository interfaces (abstract)."""
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
from ..shared.value_objects import ImdbId
|
|
from .entities import Movie
|
|
|
|
|
|
class MovieRepository(ABC):
|
|
"""
|
|
Abstract repository for movie persistence.
|
|
|
|
This defines the interface that infrastructure implementations must follow.
|
|
"""
|
|
|
|
@abstractmethod
|
|
def save(self, movie: Movie) -> None:
|
|
"""
|
|
Save a movie to the repository.
|
|
|
|
Args:
|
|
movie: Movie entity to save
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_by_imdb_id(self, imdb_id: ImdbId) -> Movie | None:
|
|
"""
|
|
Find a movie by its IMDb ID.
|
|
|
|
Args:
|
|
imdb_id: IMDb ID to search for
|
|
|
|
Returns:
|
|
Movie if found, None otherwise
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def find_all(self) -> list[Movie]:
|
|
"""
|
|
Get all movies in the repository.
|
|
|
|
Returns:
|
|
List of all movies
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def delete(self, imdb_id: ImdbId) -> bool:
|
|
"""
|
|
Delete a movie from the repository.
|
|
|
|
Args:
|
|
imdb_id: IMDb ID of the movie to delete
|
|
|
|
Returns:
|
|
True if deleted, False if not found
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def exists(self, imdb_id: ImdbId) -> bool:
|
|
"""
|
|
Check if a movie exists in the repository.
|
|
|
|
Args:
|
|
imdb_id: IMDb ID to check
|
|
|
|
Returns:
|
|
True if exists, False otherwise
|
|
"""
|
|
pass
|