forked from Sunbird-AIAssistant/sakhi-api-service
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbase.py
27 lines (19 loc) · 812 Bytes
/
base.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from abc import ABC, abstractmethod
from typing import Any, Optional
from langchain.chat_models.base import BaseChatModel
class BaseChatClient(ABC):
"""
Abstract base class for Chat clients.
This class defines the interface for creating different Chat clients.
"""
@abstractmethod
def get_client(self, model: Optional[str] = None, **kwargs: Any) -> BaseChatModel:
"""
This method must be implemented by subclasses to create and return a specific chat client instance.
Args:
model: Name of the Chat model to use.
kwargs: Additional keyword arguments to be passed to the specific Chat client constructor.
Returns:
An instance of a subclass of BaseChatModel representing the specific Chat client.
"""
pass