summaryrefslogtreecommitdiff
path: root/src/personalization/models/preference_extractor/base.py
blob: 850292f38721a06c0eefb1e567e643f9cdaa31c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from __future__ import annotations

from abc import ABC, abstractmethod
from typing import Any, Dict, List
from personalization.retrieval.preference_store.schemas import ChatTurn, PreferenceList

class PreferenceExtractorBase(ABC):
    @abstractmethod
    def extract_turn(self, turns: List[ChatTurn]) -> PreferenceList:
        """
        Extract preferences from a window of chat turns (history + current query).
        """
        raise NotImplementedError

# Alias for backward compatibility if needed, 
# though specific extractors should inherit from PreferenceExtractorBase now.
PreferenceExtractor = PreferenceExtractorBase