feat!: migrate to OpenAI native tool calls and fix circular deps (#fuck-gemini)
- 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()
This commit is contained in:
@@ -1,73 +1,73 @@
|
||||
"""TV Show repository interfaces (abstract)."""
|
||||
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List, Optional
|
||||
|
||||
from ..shared.value_objects import ImdbId
|
||||
from .entities import TVShow, Season, Episode
|
||||
from .value_objects import SeasonNumber, EpisodeNumber
|
||||
from .entities import Episode, Season, TVShow
|
||||
from .value_objects import EpisodeNumber, SeasonNumber
|
||||
|
||||
|
||||
class TVShowRepository(ABC):
|
||||
"""
|
||||
Abstract repository for TV show persistence.
|
||||
|
||||
|
||||
This defines the interface that infrastructure implementations must follow.
|
||||
"""
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def save(self, show: TVShow) -> None:
|
||||
"""
|
||||
Save a TV show to the repository.
|
||||
|
||||
|
||||
Args:
|
||||
show: TVShow entity to save
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def find_by_imdb_id(self, imdb_id: ImdbId) -> Optional[TVShow]:
|
||||
def find_by_imdb_id(self, imdb_id: ImdbId) -> TVShow | None:
|
||||
"""
|
||||
Find a TV show by its IMDb ID.
|
||||
|
||||
|
||||
Args:
|
||||
imdb_id: IMDb ID to search for
|
||||
|
||||
|
||||
Returns:
|
||||
TVShow if found, None otherwise
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def find_all(self) -> List[TVShow]:
|
||||
def find_all(self) -> list[TVShow]:
|
||||
"""
|
||||
Get all TV shows in the repository.
|
||||
|
||||
|
||||
Returns:
|
||||
List of all TV shows
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def delete(self, imdb_id: ImdbId) -> bool:
|
||||
"""
|
||||
Delete a TV show from the repository.
|
||||
|
||||
|
||||
Args:
|
||||
imdb_id: IMDb ID of the show to delete
|
||||
|
||||
|
||||
Returns:
|
||||
True if deleted, False if not found
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def exists(self, imdb_id: ImdbId) -> bool:
|
||||
"""
|
||||
Check if a TV show exists in the repository.
|
||||
|
||||
|
||||
Args:
|
||||
imdb_id: IMDb ID to check
|
||||
|
||||
|
||||
Returns:
|
||||
True if exists, False otherwise
|
||||
"""
|
||||
@@ -76,55 +76,51 @@ class TVShowRepository(ABC):
|
||||
|
||||
class SeasonRepository(ABC):
|
||||
"""Abstract repository for season persistence."""
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def save(self, season: Season) -> None:
|
||||
"""Save a season."""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def find_by_show_and_number(
|
||||
self,
|
||||
show_imdb_id: ImdbId,
|
||||
season_number: SeasonNumber
|
||||
) -> Optional[Season]:
|
||||
self, show_imdb_id: ImdbId, season_number: SeasonNumber
|
||||
) -> Season | None:
|
||||
"""Find a season by show and season number."""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def find_all_by_show(self, show_imdb_id: ImdbId) -> List[Season]:
|
||||
def find_all_by_show(self, show_imdb_id: ImdbId) -> list[Season]:
|
||||
"""Get all seasons for a show."""
|
||||
pass
|
||||
|
||||
|
||||
class EpisodeRepository(ABC):
|
||||
"""Abstract repository for episode persistence."""
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def save(self, episode: Episode) -> None:
|
||||
"""Save an episode."""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def find_by_show_season_episode(
|
||||
self,
|
||||
show_imdb_id: ImdbId,
|
||||
season_number: SeasonNumber,
|
||||
episode_number: EpisodeNumber
|
||||
) -> Optional[Episode]:
|
||||
episode_number: EpisodeNumber,
|
||||
) -> Episode | None:
|
||||
"""Find an episode by show, season, and episode number."""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def find_all_by_season(
|
||||
self,
|
||||
show_imdb_id: ImdbId,
|
||||
season_number: SeasonNumber
|
||||
) -> List[Episode]:
|
||||
self, show_imdb_id: ImdbId, season_number: SeasonNumber
|
||||
) -> list[Episode]:
|
||||
"""Get all episodes for a season."""
|
||||
pass
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def find_all_by_show(self, show_imdb_id: ImdbId) -> List[Episode]:
|
||||
def find_all_by_show(self, show_imdb_id: ImdbId) -> list[Episode]:
|
||||
"""Get all episodes for a show."""
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user