Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
与#2810 相同
Motivation / 动机
问题是由keys初始化格式不当引起的, 但是修改keys的初始值将导致dashboard默认出现一个空key的问题, 不符合逻辑
将keys的初值修补转移到获取时, 并统一供应商使用基类方法获取keys
Modifications / 改动点
Provider基类的方法
几个子类获取keys的逻辑
Verification Steps / 验证步骤
创建空key Provider即可
Screenshots or Test Results / 运行截图或测试结果
Compatibility & Breaking Changes / 兼容性与破坏性变更
Checklist / 检查清单
requirements.txt
和pyproject.toml
文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txt
andpyproject.toml
.Sourcery 总结
修复 Provider 类中空键的初始化问题,通过集中默认键逻辑并更新子类使用基础的
get_keys
方法,确保可以在没有显式键的情况下创建提供者。错误修复:
get_keys
至少返回一个空字符串键,以允许实例化没有配置键的提供者改进:
provider_config
键的直接访问替换为super().get_keys()
Original summary in English
Summary by Sourcery
Fix empty key initialization in Provider classes by centralizing default key logic and updating subclasses to use the base get_keys method, ensuring providers can be created without explicit keys.
Bug Fixes:
Enhancements: