from typing import Any, Dict, List from fastrag.retrievers import QuantizedBiEncoderRetriever class RetrieverHandler: def __init__(self, path=""): model_id = "Intel/bge-small-en-v1.5-rag-int8-static" self.retriever = QuantizedBiEncoderRetriever(embedding_model=model_id) def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]: queries = data.get("queries") assert isinstance(queries, list), "Expected a list of queries" assert all(isinstance(query, str) for query in queries), "Expected a list of strings" return self.retriever.embed_queries(queries=queries)