Initial Commit
This commit is contained in:
22
backend/interfaces/LLM_model.py
Normal file
22
backend/interfaces/LLM_model.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any, Dict, List, Optional, TypedDict
|
||||
|
||||
class GenerateParams(TypedDict):
|
||||
temperature: float
|
||||
top_p: float
|
||||
max_tokens: int
|
||||
stop_sequences: Optional[list[str]]
|
||||
|
||||
class LLMInterface(ABC):
|
||||
@abstractmethod
|
||||
def reset_context(self) -> None:
|
||||
"""Reseta o contexto da conversa"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def generate(self, prompt: str,):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def set_parameters(self, params: GenerateParams) -> None:
|
||||
pass
|
||||
Reference in New Issue
Block a user