notion / app /providers /base_provider.py
Ac66's picture
Upload folder using huggingface_hub
4cdaef7 verified
raw
history blame contribute delete
421 Bytes
from abc import ABC, abstractmethod
from typing import Dict, Any, Union
from fastapi.responses import StreamingResponse, JSONResponse
class BaseProvider(ABC):
@abstractmethod
async def chat_completion(
self,
request_data: Dict[str, Any]
) -> Union[StreamingResponse, JSONResponse]:
pass
@abstractmethod
async def get_models(self) -> JSONResponse:
pass