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

feat: sort models by name in default model dropdowns #805

Conversation

ryanhopperlowe
Copy link
Contributor

@ryanhopperlowe ryanhopperlowe commented Dec 6, 2024

Screenshot 2024-12-06 at 4 00 35 PM Screenshot 2024-12-06 at 4 01 16 PM Screenshot 2024-12-06 at 5 27 20 PM
  • sorts models by name in default model dropdowns
  • adds an "Other" group to dropdowns for models that don't have a usage
  • ensures that backend always returns a value for model usage
  • apply suggested models to default models form after configuration

Signed-off-by: Ryan Hopper-Lowe [email protected]

@@ -12,7 +12,7 @@ type ModelManifest struct {
ModelProvider string `json:"modelProvider,omitempty"`
Alias string `json:"alias,omitempty"`
Active bool `json:"active"`
Usage ModelUsage `json:"usage,omitempty"`
Usage ModelUsage `json:"usage"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made this change so the frontend can map to the backend response via enum

Copy link
Contributor

Choose a reason for hiding this comment

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

im explicitly OKing this. We'll see if a real dev yells at me later.

- sorts models by name in default model dropdowns
- adds an "Other" group to dropdowns for models that don't have a usage
- ensures that backend always returns a value for model usage

Signed-off-by: Ryan Hopper-Lowe <[email protected]>
@ryanhopperlowe ryanhopperlowe force-pushed the feat/admin/update-default-model-details branch from a02efb1 to 2f50107 Compare December 6, 2024 23:25
@cjellick cjellick merged commit 9638c7e into obot-platform:main Dec 6, 2024
1 check passed
getModelUsageFromAlias(alias) ??
ModelUsage.Unknown;

const modelOptions = filterModelsByUsage(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Just a thought but wondering if a usage is set, should the options show both ones marked as usage and the unknowns? In case a type is set for one, but maybe a user wanted to find one of the unknowns?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check the renderSelectModelContent method :)

@ryanhopperlowe ryanhopperlowe deleted the feat/admin/update-default-model-details branch December 6, 2024 23:39
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.

3 participants