Skip to content
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: embedding models not showing in the dropdown #476

Merged
merged 2 commits into from
Nov 10, 2024

Conversation

weilirs
Copy link
Collaborator

@weilirs weilirs commented Nov 7, 2024

Fallback for embeddings that don't have readableName and description attributes.

Before:
image

After:
image

@weilirs weilirs requested a review from samlhuillier November 7, 2024 02:41
Copy link

@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

Added fallback handling for embedding models without readableName in the dropdown menu to prevent display issues.

  • Modified src/components/Settings/EmbeddingSettings/EmbeddingModelSelect.tsx to use model name as fallback when readableName is undefined
  • Potential security concern: Displaying raw model names without sanitization could expose system paths or sensitive information
  • Missing validation for description field could lead to undefined being rendered in UI
  • Consider adding input validation for model attributes when they are first stored

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -22,7 +22,7 @@ const EmbeddingModelSelect: React.FC<EmbeddingModelSelectProps> = ({
{Object.entries(embeddingModels).map(([model, config]) => (
<SelectItem key={model} value={model}>
<div>
<div>{config.readableName}</div>
<div>{config.readableName || model}</div>
<div className="text-xs text-gray-400">{config.description}</div>
Copy link

Choose a reason for hiding this comment

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

logic: Description field needs a fallback value to prevent 'undefined' from being displayed

@samlhuillier samlhuillier merged commit fd1cb7c into reorproject:main Nov 10, 2024
4 checks passed
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