mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-31 15:47:05 +00:00
41 lines
1.2 KiB
Python
41 lines
1.2 KiB
Python
"""Proxy models."""
|
|
|
|
|
|
def __lazy_import(name):
|
|
module_path = {
|
|
"OpenAILLMClient": "dbgpt.model.proxy.llms.chatgpt",
|
|
"GeminiLLMClient": "dbgpt.model.proxy.llms.gemini",
|
|
"SparkLLMClient": "dbgpt.model.proxy.llms.spark",
|
|
"TongyiLLMClient": "dbgpt.model.proxy.llms.tongyi",
|
|
"WenxinLLMClient": "dbgpt.model.proxy.llms.wenxin",
|
|
"ZhipuLLMClient": "dbgpt.model.proxy.llms.zhipu",
|
|
"YiLLMClient": "dbgpt.model.proxy.llms.yi",
|
|
"MoonshotLLMClient": "dbgpt.model.proxy.llms.moonshot",
|
|
"OllamaLLMClient": "dbgpt.model.proxy.llms.ollama",
|
|
"DeepseekLLMClient": "dbgpt.model.proxy.llms.deepseek",
|
|
}
|
|
|
|
if name in module_path:
|
|
module = __import__(module_path[name], fromlist=[name])
|
|
return getattr(module, name)
|
|
else:
|
|
raise AttributeError(f"module {__name__} has no attribute {name}")
|
|
|
|
|
|
def __getattr__(name):
|
|
return __lazy_import(name)
|
|
|
|
|
|
__all__ = [
|
|
"OpenAILLMClient",
|
|
"GeminiLLMClient",
|
|
"TongyiLLMClient",
|
|
"ZhipuLLMClient",
|
|
"WenxinLLMClient",
|
|
"SparkLLMClient",
|
|
"YiLLMClient",
|
|
"MoonshotLLMClient",
|
|
"OllamaLLMClient",
|
|
"DeepseekLLMClient",
|
|
]
|