-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #402 from Undertone0809/v1.13.1/add-lazy-import-fo…
…r-llm fix: jwt not found in zhipu llm
- Loading branch information
Showing
2 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,41 @@ | |
# Project Link: https://github.com/Undertone0809/promptulate | ||
# Contact Email: [email protected] | ||
|
||
from promptulate.llms.base import BaseLLM | ||
from promptulate.llms.erniebot.erniebot import ErnieBot | ||
from promptulate.llms.openai import ChatOpenAI, OpenAI | ||
from promptulate.llms.qianfan import QianFan | ||
from promptulate.llms.zhipu import ZhiPu | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from promptulate.llms.base import BaseLLM | ||
from promptulate.llms.erniebot.erniebot import ErnieBot | ||
from promptulate.llms.openai import ChatOpenAI, OpenAI | ||
from promptulate.llms.qianfan import QianFan | ||
from promptulate.llms.zhipu import ZhiPu | ||
|
||
|
||
def __getattr__(name): | ||
if name == "BaseLLM": | ||
from promptulate.llms.base import BaseLLM | ||
|
||
return BaseLLM | ||
elif name == "ErnieBot": | ||
from promptulate.llms.erniebot.erniebot import ErnieBot | ||
|
||
return ErnieBot | ||
elif name == "ChatOpenAI": | ||
from promptulate.llms.openai import ChatOpenAI | ||
|
||
return ChatOpenAI | ||
elif name == "OpenAI": | ||
from promptulate.llms.openai import OpenAI | ||
|
||
return OpenAI | ||
elif name == "QianFan": | ||
from promptulate.llms.qianfan import QianFan | ||
|
||
return QianFan | ||
elif name == "ZhiPu": | ||
from promptulate.llms.zhipu import ZhiPu | ||
|
||
return ZhiPu | ||
|
||
|
||
__all__ = ["OpenAI", "ChatOpenAI", "BaseLLM", "ErnieBot", "QianFan", "ZhiPu"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters