feat(setting): set default model setting 自动重置默认模型#1813
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
该 PR 针对管理端「自动配置」模式下的对话模型选择逻辑做了“默认值归一化”,确保当后端/历史配置传入的 initialChatModel 不在预置模型列表中时,前端会自动回退到默认模型,从而避免出现无效模型导致的选择框异常或配置不可用。
Changes:
- 将「百智云 Chat 模型列表」提升为组件外常量,避免每次渲染重复创建。
- 新增
getDefaultChatModel:当传入模型不在白名单时,自动回退到列表首个默认模型。 - 初始化与
initialChatModel更新时,统一通过getDefaultChatModel进行默认模型重置。
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR 标题
自动重置默认模型
变更类型
请勾选适用的变更类型:
变更内容
详细描述本次 PR 的具体变更内容:
测试情况
描述本次变更的测试情况:
其他说明
任何其他需要说明的事项: