Skip to content

Commit 311a7e1

Browse files
committed
Remove unused fields from modelsdev Provider and Model types
Assisted-By: docker-agent
1 parent 4f347d8 commit 311a7e1

3 files changed

Lines changed: 5 additions & 36 deletions

File tree

pkg/config/model_alias_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ func TestResolveModelAliases(t *testing.T) {
1616
mockData := &modelsdev.Database{
1717
Providers: map[string]modelsdev.Provider{
1818
"anthropic": {
19-
ID: "anthropic",
20-
Name: "Anthropic",
2119
Models: map[string]modelsdev.Model{
2220
"claude-sonnet-4-5": {Name: "Claude Sonnet 4.5 (latest)"},
2321
"claude-sonnet-4-5-20250929": {Name: "Claude Sonnet 4.5"},

pkg/modelsdev/types.go

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,16 @@ type Database struct {
1010

1111
// Provider represents an AI model provider
1212
type Provider struct {
13-
ID string `json:"id"`
14-
Name string `json:"name"`
15-
Doc string `json:"doc,omitempty"`
16-
API string `json:"api,omitempty"`
17-
NPM string `json:"npm,omitempty"`
18-
Env []string `json:"env,omitempty"`
1913
Models map[string]Model `json:"models"`
2014
}
2115

2216
// Model represents an AI model with its specifications and capabilities
2317
type Model struct {
24-
ID string `json:"id"`
25-
Name string `json:"name"`
26-
Family string `json:"family,omitempty"`
27-
Attachment bool `json:"attachment"`
28-
Reasoning bool `json:"reasoning"`
29-
Temperature bool `json:"temperature"`
30-
ToolCall bool `json:"tool_call"`
31-
Knowledge string `json:"knowledge,omitempty"`
32-
ReleaseDate string `json:"release_date"`
33-
LastUpdated string `json:"last_updated"`
34-
OpenWeights bool `json:"open_weights"`
35-
Cost *Cost `json:"cost,omitempty"`
36-
Limit Limit `json:"limit"`
37-
Modalities Modalities `json:"modalities"`
18+
Name string `json:"name"`
19+
Family string `json:"family,omitempty"`
20+
Cost *Cost `json:"cost,omitempty"`
21+
Limit Limit `json:"limit"`
22+
Modalities Modalities `json:"modalities"`
3823
}
3924

4025
// Cost represents the pricing information for a model

pkg/runtime/model_switcher_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -244,25 +244,20 @@ func TestBuildCatalogChoices(t *testing.T) {
244244
db := &modelsdev.Database{
245245
Providers: map[string]modelsdev.Provider{
246246
"openai": {
247-
ID: "openai",
248-
Name: "OpenAI",
249247
Models: map[string]modelsdev.Model{
250248
"gpt-4o": {
251-
ID: "gpt-4o",
252249
Name: "GPT-4o",
253250
Modalities: modelsdev.Modalities{
254251
Output: []string{"text"},
255252
},
256253
},
257254
"dall-e-3": {
258-
ID: "dall-e-3",
259255
Name: "DALL-E 3",
260256
Modalities: modelsdev.Modalities{
261257
Output: []string{"image"}, // Not a text model
262258
},
263259
},
264260
"text-embedding-3-large": {
265-
ID: "text-embedding-3-large",
266261
Name: "Text Embedding 3 Large",
267262
Family: "text-embedding",
268263
Modalities: modelsdev.Modalities{
@@ -272,11 +267,8 @@ func TestBuildCatalogChoices(t *testing.T) {
272267
},
273268
},
274269
"anthropic": {
275-
ID: "anthropic",
276-
Name: "Anthropic",
277270
Models: map[string]modelsdev.Model{
278271
"claude-sonnet-4-0": {
279-
ID: "claude-sonnet-4-0",
280272
Name: "Claude Sonnet 4",
281273
Modalities: modelsdev.Modalities{
282274
Output: []string{"text"},
@@ -285,11 +277,8 @@ func TestBuildCatalogChoices(t *testing.T) {
285277
},
286278
},
287279
"unsupported": {
288-
ID: "unsupported",
289-
Name: "Unsupported Provider",
290280
Models: map[string]modelsdev.Model{
291281
"some-model": {
292-
ID: "some-model",
293282
Name: "Some Model",
294283
Modalities: modelsdev.Modalities{
295284
Output: []string{"text"},
@@ -348,11 +337,8 @@ func TestBuildCatalogChoicesWithDuplicates(t *testing.T) {
348337
db := &modelsdev.Database{
349338
Providers: map[string]modelsdev.Provider{
350339
"openai": {
351-
ID: "openai",
352-
Name: "OpenAI",
353340
Models: map[string]modelsdev.Model{
354341
"gpt-4o": {
355-
ID: "gpt-4o",
356342
Name: "GPT-4o",
357343
Modalities: modelsdev.Modalities{
358344
Output: []string{"text"},

0 commit comments

Comments
 (0)