-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes baiducloud bug and partial code formatting (Sourcery refactored) #984
Conversation
self.config.response.default_ai = 'chatgpt-web' | ||
elif len(self.bots['openai-api']) > 0: | ||
self.config.response.default_ai = 'chatgpt-api' | ||
elif len(self.bots['bing-cookie']) > 0: | ||
self.config.response.default_ai = 'bing' | ||
elif len(self.bots['bard-cookie']) > 0: | ||
self.config.response.default_ai = 'bard' | ||
elif len(self.bots['yiyan-cookie']) > 0: | ||
self.config.response.default_ai = 'yiyan' | ||
elif len(self.bots['chatglm-api']) > 0: | ||
self.config.response.default_ai = 'chatglm-api' | ||
elif len(self.bots['xinghuo-cookie']) > 0: | ||
self.config.response.default_ai = 'xinghuo' | ||
elif len(self.bots['slack-accesstoken']) > 0: | ||
self.config.response.default_ai = 'slack-claude' | ||
else: | ||
self.config.response.default_ai = 'chatgpt-web' | ||
# 自动推测默认 AI | ||
default_ai_mappings = { | ||
"poe-web": "poe-chatgpt", | ||
"slack-accesstoken": "slack-claude", | ||
"chatgpt-web": "chatgpt-web", | ||
"openai-api": "chatgpt-api", | ||
"bing-cookie": "bing", | ||
"bard-cookie": "bard", | ||
"yiyan-cookie": "yiyan", | ||
"chatglm-api": "chatglm-api", | ||
"xinghuo-cookie": "xinghuo", | ||
} | ||
|
||
self.config.response.default_ai = next( | ||
( | ||
default_ai | ||
for key, default_ai in default_ai_mappings.items() | ||
if len(self.bots[key]) > 0 | ||
), | ||
'chatgpt-web', | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function BotManager.login
refactored with the following changes:
- Move assignments closer to their usage (
move-assign
) - Use the built-in function
next
instead of a for-loop (use-next
)
详情见 漏洞依然没有被修复仍然无法调用百度云文本审核以下是控制台输出信息
以下是配置信息
|
出错了就肯定不会有审核 |
所以错误仍然未被修复! |
这个是你账户的问题,不是我们这边的问题,百度云审核导致的程序出错已经被正常的修复 |
Pull Request #983 refactored by Sourcery.
Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it.
To incorporate these changes, you can either:
Merge this Pull Request instead of the original, or
Ask your contributor to locally incorporate these commits and push them to
the original Pull Request
Incorporate changes via command line
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Help us improve this pull request!