Skip to content

Commit

Permalink
fix: adds model provider in dropdown options for default models (#851)
Browse files Browse the repository at this point in the history
* fix: adds model provider in dropdown options for default models

* Update DefaultModelAliasForm.tsx

* Update AgentForm.tsx
  • Loading branch information
ivyjeong13 authored Dec 13, 2024
1 parent a27cc61 commit 32b70a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
5 changes: 3 additions & 2 deletions ui/admin/app/components/agent/AgentForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ export function AgentForm({ agent, onSubmit, onChange }: AgentFormProps) {

{models.map((m) => (
<SelectItem key={m.id} value={m.id}>
{m.name || m.id}{" "}
{m.name || m.id}
{" - "}
<span className="text-muted-foreground">
({m.modelProvider})
{m.modelProvider}
</span>
</SelectItem>
))}
Expand Down
22 changes: 13 additions & 9 deletions ui/admin/app/components/model/DefaultModelAliasForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ export function DefaultModelAliasForm({
{otherModels.map((model) => (
<SelectItem key={model.id} value={model.id}>
{model.name || model.id}
{" - "}
<span className="text-muted-foreground">
{model.modelProvider}
</span>
</SelectItem>
))}
</SelectGroup>
Expand All @@ -271,16 +275,16 @@ export function DefaultModelAliasForm({
function getModelOptionLabel(model: Model, aliasFor: ModelAlias) {
// if the model name is the same as the suggested model name, show that it's suggested
const suggestionName = SUGGESTED_MODEL_SELECTIONS[aliasFor];
if (suggestionName === model.name) {
return (
<>
{model.name || model.id}{" "}
return (
<>
{model.name || model.id}{" "}
{suggestionName === model.name && (
<span className="text-muted-foreground">(Suggested)</span>
</>
);
}

return model.name || model.id;
)}
{" - "}
<span className="text-muted-foreground">{model.modelProvider}</span>
</>
);
}

export function DefaultModelAliasFormDialog({
Expand Down

0 comments on commit 32b70a2

Please sign in to comment.