Skip to content

Conversation

Weves
Copy link
Contributor

@Weves Weves commented May 2, 2025

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.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Weves Weves requested a review from a team as a code owner May 2, 2025 23:30
Copy link

vercel bot commented May 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 4, 2025 0:49am

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 structured model_configurations in WellKnownLLMProviderDescriptor to support visibility flags and image input capabilities
  • Updated LLMProviderUpdateForm to handle model visibility and configuration through selected_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

Copy link
Contributor

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?

Copy link
Contributor Author

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!

Comment on lines +371 to +384
(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,
})
)}
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Comment on lines +409 to +421
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated here.

Comment on lines +335 to +349
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,
})
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated here as well.

Comment on lines 149 to 153
({
name: modelConfiguration.name,
is_visible: visibleModels.includes(modelConfiguration.name),
max_input_tokens: null,
}) as ModelConfiguration
Copy link
Contributor

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?

Copy link
Contributor Author

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

@Weves Weves force-pushed the fix-playwright-test branch from e08c77f to 8eda254 Compare May 4, 2025 00:44
@Weves Weves merged commit 6085bff into main May 4, 2025
11 checks passed
@Weves Weves deleted the fix-playwright-test branch May 4, 2025 21:04
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* Fix test / display models

* Address greptile comments

* Increase wait time

* Increase overall timeout

* Move stuff to utils file

* Updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants