-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix test / display models #4657
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR refactors the LLM provider system to improve model configuration management and display. Here's a summary of the key changes:
- Replaced
llm_names
with structuredmodel_configurations
inWellKnownLLMProviderDescriptor
to support visibility flags and image input capabilities - Updated
LLMProviderUpdateForm
to handle model visibility and configuration throughselected_model_names
state - Modified
ConfiguredLLMProviderDisplay
to properly compare model configurations when determining provider types - Fixed model name references in tests to match current naming scheme (e.g., 'GPT 4o Mini')
- Aligned LLM descriptor structure in hooks to use
provider
field consistently across the application
The changes improve type safety and maintainability while fixing issues with model display and provider identification.
6 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
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.
The logic prior to change just had the default and fast-default models visible, correct?
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.
@raunakab yep that's correct!
(modelConfiguration) => ({ | ||
// don't clean up names here to give admins descriptive names / handle duplicates | ||
// like us.anthropic.claude-3-7-sonnet-20250219-v1:0 and anthropic.claude-3-7-sonnet-20250219-v1:0 | ||
name: modelConfiguration.name, | ||
value: modelConfiguration.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.
This logic seems to be duplicated many times. Maybe we could pull it out into its own helper function?
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.
imo this is simple enough / some of the usages are slightly different that it doesn't warrant a helper
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.
e.g. some have name
and value
where as others have value
and label
.
Putting into a helper makes it a little less explicit as well
options={llmProviderDescriptor.model_configurations.map( | ||
(modelConfiguration) => ({ | ||
value: modelConfiguration.name, | ||
// don't clean up names here to give admins descriptive names / handle duplicates | ||
// like us.anthropic.claude-3-7-sonnet-20250219-v1:0 and anthropic.claude-3-7-sonnet-20250219-v1:0 | ||
label: name, | ||
label: modelConfiguration.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.
Duplicated here.
options={llmProviderDescriptor.model_configurations.map( | ||
(modelConfiguration) => ({ | ||
// don't clean up names here to give admins descriptive names / handle duplicates | ||
// like us.anthropic.claude-3-7-sonnet-20250219-v1:0 and anthropic.claude-3-7-sonnet-20250219-v1:0 | ||
name: modelConfiguration.name, | ||
value: modelConfiguration.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.
Duplicated here as well.
({ | ||
name: modelConfiguration.name, | ||
is_visible: visibleModels.includes(modelConfiguration.name), | ||
max_input_tokens: null, | ||
}) as ModelConfiguration |
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.
Does the ModelConfiguration
type that we have defined not also require supports_image_input
to be set?
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.
Addressed! Really should be ModelConfigurationUpsertRequest
* Fix test / display models * Address greptile comments * Increase wait time * Increase overall timeout * Move stuff to utils file * Updates
Description
Fixes https://linear.app/danswer/issue/DAN-1939/fix-playwright-testsmodel-iconsdefault-display-icons
How Has This Been Tested?
Tested with OpenAI/anthropic locally.
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.