update: ai info 移除url, api-key等敏感信息展示
This commit is contained in:
@@ -149,7 +149,7 @@ class AiBotPlugin(AbsExtraConfigPlugin):
|
||||
show_infos.append(f"platform: {self.get_cur_platform()}\n\n")
|
||||
show_infos.append("platform detail: \n\n")
|
||||
# 查询当前ai平台的配置信息
|
||||
p_m_dict = dict(self.config['platforms'][self.get_cur_platform()])
|
||||
p_m_dict = self.get_config()
|
||||
for k, v in p_m_dict.items():
|
||||
show_infos.append(f"- {k}: {v}\n")
|
||||
# 当前使用的model
|
||||
@@ -158,6 +158,16 @@ class AiBotPlugin(AbsExtraConfigPlugin):
|
||||
await event.reply("".join(show_infos), markdown=True)
|
||||
pass
|
||||
|
||||
"""
|
||||
获取配置信息
|
||||
"""
|
||||
def get_config(self) -> dict:
|
||||
platform_config_dict = dict(self.config['platforms'][self.get_cur_platform()])
|
||||
# 移除敏感配置
|
||||
platform_config_dict.pop('api_key')
|
||||
platform_config_dict.pop('url')
|
||||
return platform_config_dict
|
||||
|
||||
"""
|
||||
获取实际平台名称
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user