Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

74 lines
2.3KB

  1. """
  2. channel factory
  3. """
  4. from common import const
  5. from common.log import logger
  6. def create_bot(bot_type):
  7. """
  8. create a bot_type instance
  9. :param bot_type: bot type code
  10. :return: bot instance
  11. """
  12. if bot_type == const.BAIDU:
  13. # 替换Baidu Unit为Baidu文心千帆对话接口
  14. # from bot.baidu.baidu_unit_bot import BaiduUnitBot
  15. # return BaiduUnitBot()
  16. from bot.baidu.baidu_wenxin import BaiduWenxinBot
  17. return BaiduWenxinBot()
  18. elif bot_type == const.CHATGPT:
  19. # ChatGPT 网页端web接口
  20. from bot.chatgpt.chat_gpt_bot import ChatGPTBot
  21. return ChatGPTBot()
  22. elif bot_type == const.OPEN_AI:
  23. # OpenAI 官方对话模型API
  24. from bot.openai.open_ai_bot import OpenAIBot
  25. return OpenAIBot()
  26. elif bot_type == const.CHATGPTONAZURE:
  27. # Azure chatgpt service https://azure.microsoft.com/en-in/products/cognitive-services/openai-service/
  28. from bot.chatgpt.chat_gpt_bot import AzureChatGPTBot
  29. return AzureChatGPTBot()
  30. elif bot_type == const.XUNFEI:
  31. from bot.xunfei.xunfei_spark_bot import XunFeiBot
  32. return XunFeiBot()
  33. elif bot_type == const.LINKAI:
  34. from bot.linkai.link_ai_bot import LinkAIBot
  35. return LinkAIBot()
  36. elif bot_type == const.CLAUDEAI:
  37. from bot.claude.claude_ai_bot import ClaudeAIBot
  38. return ClaudeAIBot()
  39. elif bot_type == const.CLAUDEAPI:
  40. from bot.claudeapi.claude_api_bot import ClaudeAPIBot
  41. return ClaudeAPIBot()
  42. elif bot_type == const.QWEN:
  43. from bot.ali.ali_qwen_bot import AliQwenBot
  44. return AliQwenBot()
  45. elif bot_type == const.QWEN_DASHSCOPE:
  46. from bot.dashscope.dashscope_bot import DashscopeBot
  47. return DashscopeBot()
  48. elif bot_type == const.GEMINI:
  49. from bot.gemini.google_gemini_bot import GoogleGeminiBot
  50. return GoogleGeminiBot()
  51. elif bot_type == const.ZHIPU_AI:
  52. from bot.zhipuai.zhipuai_bot import ZHIPUAIBot
  53. return ZHIPUAIBot()
  54. elif bot_type == const.MOONSHOT:
  55. from bot.moonshot.moonshot_bot import MoonshotBot
  56. return MoonshotBot()
  57. elif bot_type == const.MiniMax:
  58. from bot.minimax.minimax_bot import MinimaxBot
  59. return MinimaxBot()
  60. raise RuntimeError