-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
35 additions
and
18 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 |
---|---|---|
|
@@ -5,4 +5,5 @@ config.json | |
assets/*.png | ||
assets/*.mp4 | ||
.ruff_cache | ||
plugins/**/ | ||
plugins/**/ | ||
litellm_uuid.txt |
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 |
---|---|---|
@@ -1,26 +1,36 @@ | ||
import litellm | ||
# import litellm | ||
from common.context import Context | ||
from config import conf | ||
from common.singleton import singleton | ||
from common.reply import Reply | ||
|
||
|
||
|
||
@singleton | ||
class Bot: | ||
def __init__(self): | ||
use_azure_chatgpt = conf().get("use_azure_chatgpt", False) | ||
model = conf().get("model", "gpt-3.5-turbo") | ||
# model = conf().get("model", "gpt-3.5-turbo") | ||
if use_azure_chatgpt: | ||
from bot.azure_chatgpt import AzureChatGPTBot | ||
|
||
self.bot = AzureChatGPTBot() | ||
elif model in litellm.model_list: | ||
# see litellm supported models here: | ||
# https://litellm.readthedocs.io/en/latest/supported/ | ||
from bot.litellm import liteLLMChatGPTBot | ||
self.bot = liteLLMChatGPTBot() | ||
else: | ||
from bot.chatgpt import ChatGPTBot | ||
self.bot = ChatGPTBot() | ||
# see litellm supported models here: | ||
# https://litellm.readthedocs.io/en/latest/supported/ | ||
from bot.litellm import LiteLLMChatGPTBot | ||
|
||
self.bot = LiteLLMChatGPTBot() | ||
|
||
# elif model in litellm.open_ai_chat_completion_models: | ||
# from bot.chatgpt import ChatGPTBot | ||
|
||
# self.bot = ChatGPTBot() | ||
# else: | ||
# # see litellm supported models here: | ||
# # https://litellm.readthedocs.io/en/latest/supported/ | ||
# from bot.litellm import LiteLLMChatGPTBot | ||
|
||
# self.bot = LiteLLMChatGPTBot() | ||
|
||
def reply(self, context: Context) -> Reply: | ||
return self.bot.reply(context) |
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