Skip to content

Commit fc60a3b

Browse files
committed
feat(ui): add BYOK model customization and grouping
- Add custom naming for BYOK models via 'title' property in settings.json configuration - Implement BYOK model tag with corresponding badge display - Update model dropdown UI to include BYOK group - Remove deprecated Vision group - Bump version to 1.67.0+5
1 parent 3053b4a commit fc60a3b

File tree

4 files changed

+132
-12
lines changed

4 files changed

+132
-12
lines changed

lib/shared/src/models/sync.ts

+2
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ function normalizeModelList(models: Model[]): Model[] {
413413
export interface ChatModelProviderConfig {
414414
provider: string
415415
model: string
416+
title?: string
416417
inputTokens?: number
417418
outputTokens?: number
418419
apiKey?: string
@@ -452,6 +453,7 @@ function getModelsFromVSCodeConfiguration({
452453
options: m.options,
453454
},
454455
tags: tags,
456+
title: m.title,
455457
})
456458
}) ?? []
457459
)

pnpm-lock.yaml

+122-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "cody-ai",
44
"private": true,
55
"displayName": "Cody: AI Code Assistant",
6-
"version": "1.67.0+4",
6+
"version": "1.67.0+5",
77
"publisher": "sourcegraph",
88
"license": "Apache-2.0",
99
"icon": "resources/sourcegraph.png",

vscode/webviews/components/modelSelectField/ModelSelectField.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ const getBadgeText = (model: Model, modelAvailability?: ModelAvailability): stri
336336
[ModelTag.Recommended]: 'Recommended',
337337
[ModelTag.Deprecated]: 'Deprecated',
338338
[ModelTag.Dev]: 'Preview',
339+
[ModelTag.BYOK]: 'BYOK',
339340
}
340341

341342
return model.tags.reduce((text, tag) => text || tagToText[tag] || '', null as string | null)
@@ -384,7 +385,7 @@ const ModelTitleWithIcon: React.FC<{
384385
'tw-opacity-75': modelAvailability === 'needs-cody-pro',
385386
})}
386387
>
387-
{isGeminiFlash2Model(model) ? 'Vision' : modelBadge}
388+
{model.tags.includes(ModelTag.BYOK) ? 'BYOK' : modelBadge}
388389
</Badge>
389390
)}
390391
</span>
@@ -407,7 +408,7 @@ const ModelUIGroup: Record<string, string> = {
407408
Speed: 'Faster models',
408409
Ollama: 'Ollama (Local models)',
409410
Other: 'Other',
410-
Vision: 'Vision',
411+
BYOK: 'BYOK',
411412
}
412413

413414
const getModelDropDownUIGroup = (model: Model): string => {
@@ -417,7 +418,8 @@ const getModelDropDownUIGroup = (model: Model): string => {
417418
if (model.tags.includes(ModelTag.Balanced)) return ModelUIGroup.Balanced
418419
if (model.tags.includes(ModelTag.Speed)) return ModelUIGroup.Speed
419420
if (model.tags.includes(ModelTag.Ollama)) return ModelUIGroup.Ollama
420-
if (model.tags.includes(ModelTag.Vision)) return ModelUIGroup.Vision
421+
if (model.tags.includes(ModelTag.BYOK)) return ModelUIGroup.BYOK
422+
//if (model.tags.includes(ModelTag.Vision)) return ModelUIGroup.Vision
421423
return ModelUIGroup.Other
422424
}
423425

@@ -428,7 +430,8 @@ const optionByGroup = (
428430
ModelUIGroup.Power,
429431
ModelUIGroup.Balanced,
430432
ModelUIGroup.Speed,
431-
ModelUIGroup.Vision,
433+
ModelUIGroup.BYOK,
434+
//ModelUIGroup.Vision,
432435
ModelUIGroup.Ollama,
433436
ModelUIGroup.Other,
434437
]

0 commit comments

Comments
 (0)