diff --git a/bot/linkai/link_ai_bot.py b/bot/linkai/link_ai_bot.py index e7b9703..a92466d 100644 --- a/bot/linkai/link_ai_bot.py +++ b/bot/linkai/link_ai_bot.py @@ -37,22 +37,22 @@ class LinkAIBot(Bot): session.messages.pop(0) # load config - app_code = conf().get("app_code") - app_market_api_key = conf().get("app_market_api_key") + app_code = conf().get("linkai_app_code") + linkai_api_key = conf().get("linkai_api_key") logger.info(f"[LINKAI] query={query}, app_code={app_code}") body = { "appCode": app_code, "messages": session.messages } - headers = {"Authorization": "Bearer " + app_market_api_key} + headers = {"Authorization": "Bearer " + linkai_api_key} # do http request res = requests.post(url=self.base_url + "/chat/completion", json=body, headers=headers).json() if not res or not res["success"]: if res.get("code") == self.AUTH_FAILED_CODE: - logger.exception(f"[LINKAI] please check your app_market_api_key, res={res}") + logger.exception(f"[LINKAI] please check your linkai_api_key, res={res}") return Reply(ReplyType.ERROR, "请再问我一次吧") else: # retry diff --git a/bridge/bridge.py b/bridge/bridge.py index 4de71fe..119e855 100644 --- a/bridge/bridge.py +++ b/bridge/bridge.py @@ -23,7 +23,7 @@ class Bridge(object): self.btype["chat"] = const.OPEN_AI if conf().get("use_azure_chatgpt", False): self.btype["chat"] = const.CHATGPTONAZURE - if conf().get("app_market_api_key") and conf().get("app_code"): + if conf().get("linkai_api_key") and conf().get("linkai_app_code"): self.btype["chat"] = const.LINKAI self.bots = {} diff --git a/config.py b/config.py index 97f5feb..26b2f8a 100644 --- a/config.py +++ b/config.py @@ -99,9 +99,9 @@ available_setting = { "appdata_dir": "", # 数据目录 # 插件配置 "plugin_trigger_prefix": "$", # 规范插件提供聊天相关指令的前缀,建议不要和管理员指令前缀"#"冲突 - # 应用市场配置 - "app_market_api_key": "", - "app_code": "" + # 知识库平台配置 + "linkai_api_key": "", + "linkai_app_code": "" }