-
Notifications
You must be signed in to change notification settings - Fork 60k
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
Fix defaultModel undefined error #5071
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
please see L82:
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.
Pardon me, I don't understand your meaning. I know modelTable's key include the provider name, but the defaultModel should also specify the provider. Is there any problem here?
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.
我的意思是,当前系统已经是一个在线上运行了挺长时间,并且有很多人自己部署的系统。
所以,牵涉到配置相关的东西,需要尽量做到旧的配置能平稳迁移到新系统。
所以,这里可能需要做一下兼容(当用户旧的defaultModel没有配置provider name的时候,期望也能正常生效)
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.
translate:
I mean, the current system is one that has been running online for a long time and has been deployed by many people themselves.
Therefore, when it comes to configuration-related things, it is necessary to ensure that the old configuration can be smoothly migrated to the new system.
Therefore, some compatibility may be required here (when the user's old defaultModel does not have the provider name configured, it is expected to take effect normally).
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.
了解了,但鉴于用户旧的default_model没有指定provider,我选择创建一个独立的可选项,而不是帮他自动选择一个provider(如图)。
这同时也兼容了用户旧的default_model所指定的模型可能不在custom_models中的情况。
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.
或许针对就配置,帮用户选中匹配到的第一个才是合理的?
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.
但我们选到的第一个provider不一定可用,同时也会让这个函数变得繁琐,因为如果没有遍历到对应的模型,我们依旧需要create一个新element。
事实上我认为由用户来指定一个provider是必要的,如果用户没有指定,我们或许不应该随机选择。
当然如果你坚持,我将进行修改,毕竟两种方案在我看来都是可行的。
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.
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.
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.
是的,我也感觉创建一个新的不合理,但由于在之前的版本并没有检查defaultModel是否在modelTable中,因此我担心有用户的配置是靠这个"bug"生效的。
如果你觉得可以,我也打算如果找不到便不再创建新的,以免这个新创建的模型并不能正确的进行对话。