-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat: model selection error handling #73
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -68,6 +72,29 @@ export const SettingsModal = memo(function SettingsModal({ | |||
} | |||
}; | |||
|
|||
const handleChangeModel = async (v: string) => { | |||
if (await checkModelAccess(v)) { |
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.
should we add a loading state with the <Spinner />
when calling handleChangeModel
? User experience feels less snappy when selecting new model with small delay.
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.
hmmm if we could do with a small diff that might be nice but its probably fine as is imo
hey sorry for the delay here — this code looks great! however... the whitelist checking just doesn't seem to work. i have both gpt-4 and 32k access and when i use the vercel preview for this PR i cant use either of them? |
I just opened #83, which has some overlap with this (but fetches model list on app launch / API key change, and offers all available gpt chat models to the user). |
@adietrichs correct me if im wrong but #83 basically replaces this PR, i dont see a reason for them to coexist — and #83 is probably the ideal solution |
feel free to correct me again if im missing something but going to close this PR for now as i feel #83 supersedes it |
Motivation
Requested in #26 since GPT-4 nor GPT-4-32k isn't available for everyone yet and it would be a better experience to see something pop up instead of not being sure what happened.
Solution
On model change in settings:
Checklist
PR-Codex overview
This PR adds a new function
checkModelAccess
to validate access to OpenAI models and updates theSettingsModal
component to use it when changing the selected model.Detailed summary
checkModelAccess
function to validate access to OpenAI modelsSettingsModal
component to usecheckModelAccess
when changing the selected modeluseToast
hook to display error messages when changing to an unsupported model