Spaces:
Runtime error
Runtime error
Download bot/bot_factory.py from Zevol/WechatRobot: direct link, hf CLI and curl.
- Browser
- Download file 648 Bytes
-
https://huggingface.co/spaces/Zevol/WechatRobot/resolve/main/bot/bot_factory.py
- Command line
-
hf download hf://spaces/Zevol/WechatRobot/bot/bot_factory.py
-
curl -L -o bot_factory.py https://huggingface.co/spaces/Zevol/WechatRobot/resolve/main/bot/bot_factory.py
648 Bytes
| """ | |
| channel factory | |
| """ | |
| def create_bot(bot_type): | |
| """ | |
| create a channel instance | |
| :param channel_type: channel type code | |
| :return: channel instance | |
| """ | |
| if bot_type == 'baidu': | |
| # Baidu Unit对话接口 | |
| from bot.baidu.baidu_unit_bot import BaiduUnitBot | |
| return BaiduUnitBot() | |
| elif bot_type == 'chatGPT': | |
| # ChatGPT 网页端web接口 | |
| from bot.chatgpt.chat_gpt_bot import ChatGPTBot | |
| return ChatGPTBot() | |
| elif bot_type == 'openAI': | |
| # OpenAI 官方对话模型API | |
| from bot.openai.open_ai_bot import OpenAIBot | |
| return OpenAIBot() | |
| raise RuntimeError | |