forked from Sunbird-AIAssistant/sakhi-api-service
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path__init__.py
39 lines (33 loc) · 886 Bytes
/
__init__.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
28
29
30
31
32
33
34
35
36
37
38
39
import importlib
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from llm.base import (
BaseChatClient
)
from llm.openai import (
OpenAIChatClient
)
from llm.azure_openai import (
AzureChatClient
)
from llm.ollama import (
OllamaChatClient
)
# __all__ = [
# "BaseChatClient",
# "OpenAIChatClient"
# "AzureChatClient",
# "OllamaChatClient",
# ]
_module_lookup = {
"BaseChatClient" : "llm.base",
"OpenAIChatClient": "llm.openai",
"AzureChatClient": "llm.azure_openai",
"OllamaChatClient": "llm.ollama"
}
def __getattr__(name: str) -> Any:
if name in _module_lookup:
module = importlib.import_module(_module_lookup[name])
return getattr(module, name)
raise AttributeError(f"module {__name__} has no attribute {name}")
__all__ = list(_module_lookup.keys())