EXAM_RAG_API / stores /llm /LLMInterface.py
MinaNasser's picture
1st
1bc3f18
raw
history blame contribute delete
631 Bytes
from abc import ABC, abstractmethod
class LLMInterface(ABC):
@abstractmethod
def set_generation_model(self, model_id: str):
pass
@abstractmethod
def set_embedding_model(self, model_id: str, embedding_size: int):
pass
@abstractmethod
def generate_text(self, prompt: str, chat_history: list=[], max_output_tokens: int=None,
temperature: float = None):
pass
@abstractmethod
def embed_text_batch(self, texts: list[str], batch_size: int = 32):
pass
@abstractmethod
def construct_prompt(self, prompt: str, role: str):
pass