Merge branch 'master' into master

This commit is contained in:
Saboteur7
2024-06-20 15:21:20 +08:00
committed by GitHub
8 changed files with 109 additions and 79 deletions

View File

@@ -1,6 +1,8 @@
# encoding:utf-8
import requests, json
import requests
import json
from common import const
from bot.bot import Bot
from bot.session_manager import SessionManager
from bridge.context import ContextType
@@ -16,9 +18,15 @@ class BaiduWenxinBot(Bot):
def __init__(self):
super().__init__()
wenxin_model = conf().get("baidu_wenxin_model") or "eb-instant"
if conf().get("model") and conf().get("model") == "wenxin-4":
wenxin_model = "completions_pro"
wenxin_model = conf().get("baidu_wenxin_model")
if wenxin_model is not None:
wenxin_model = conf().get("baidu_wenxin_model") or "eb-instant"
else:
if conf().get("model") and conf().get("model") == const.WEN_XIN:
wenxin_model = "completions"
elif conf().get("model") and conf().get("model") == const.WEN_XIN_4:
wenxin_model = "completions_pro"
self.sessions = SessionManager(BaiduWenxinSession, model=wenxin_model)
def reply(self, query, context=None):

View File

@@ -2,7 +2,6 @@
channel factory
"""
from common import const
from common.log import logger
def create_bot(bot_type):