You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 satır
923B

  1. """
  2. channel factory
  3. """
  4. from common import const
  5. def create_bot(bot_type):
  6. """
  7. create a bot_type instance
  8. :param bot_type: bot type code
  9. :return: bot instance
  10. """
  11. if bot_type == const.BAIDU:
  12. # Baidu Unit对话接口
  13. from bot.baidu.baidu_unit_bot import BaiduUnitBot
  14. return BaiduUnitBot()
  15. elif bot_type == const.CHATGPT:
  16. # ChatGPT 网页端web接口
  17. from bot.chatgpt.chat_gpt_bot import ChatGPTBot
  18. return ChatGPTBot()
  19. elif bot_type == const.OPEN_AI:
  20. # OpenAI 官方对话模型API
  21. from bot.openai.open_ai_bot import OpenAIBot
  22. return OpenAIBot()
  23. elif bot_type == const.CHATGPTONAZURE:
  24. # Azure chatgpt service https://azure.microsoft.com/en-in/products/cognitive-services/openai-service/
  25. from bot.chatgpt.chat_gpt_bot import AzureChatGPTBot
  26. return AzureChatGPTBot()
  27. raise RuntimeError