Skip to content

Commit

Permalink
Merge pull request #402 from Undertone0809/v1.13.1/add-lazy-import-fo…
Browse files Browse the repository at this point in the history
…r-llm

fix: jwt not found in zhipu llm
  • Loading branch information
Undertone0809 authored Feb 5, 2024
2 parents 6feaa15 + b68d816 commit 17ef8db
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
41 changes: 36 additions & 5 deletions promptulate/llms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "A powerful LLM Application development framework."
name = "promptulate"
readme = "README.md"
repository = "https://github.com/Undertone0809/promptulate"
version = "1.13.0"
version = "1.13.1"
keywords = [
"promptulate",
"pne",
Expand Down

0 comments on commit 17ef8db

Please sign in to comment.