22 lines
709 B
Python
22 lines
709 B
Python
from typing import Tuple, Union
|
|
|
|
|
|
class LLMBackend:
|
|
def handle_response(self, success, response, error_msg, client_ip, token, prompt, elapsed_time, parameters, headers):
|
|
raise NotImplementedError
|
|
|
|
def validate_params(self, params_dict: dict) -> Tuple[bool, str | None]:
|
|
raise NotImplementedError
|
|
|
|
# def get_model_info(self) -> Tuple[dict | bool, Exception | None]:
|
|
# raise NotImplementedError
|
|
|
|
def get_parameters(self, parameters) -> Union[dict, None]:
|
|
"""
|
|
Validate and return the parameters for this backend.
|
|
Lets you set defaults for specific backends.
|
|
:param parameters:
|
|
:return:
|
|
"""
|
|
raise NotImplementedError
|