MCPcopy Index your code
hub / github.com/docker/docker-agent / TestLoadCaps_TextOnlyModel

Function TestLoadCaps_TextOnlyModel

pkg/modelinfo/modelinfo_test.go:484–507  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

482}
483
484func TestLoadCaps_TextOnlyModel(t *testing.T) {
485 t.Parallel()
486
487 store := modelsdev.NewDatabaseStore(&modelsdev.Database{Providers: map[string]modelsdev.Provider{
488 "openai": {
489 Models: map[string]modelsdev.Model{
490 "gpt-3.5-turbo": {
491 Name: "GPT-3.5 Turbo",
492 Modalities: modelsdev.Modalities{
493 Input: []string{"text"},
494 Output: []string{"text"},
495 },
496 },
497 },
498 },
499 }})
500
501 mc := LoadCaps(t.Context(), store, modelsdev.NewID("openai", "gpt-3.5-turbo"))
502
503 assert.False(t, mc.Supports("image/jpeg"))
504 assert.False(t, mc.Supports("application/pdf"))
505 assert.True(t, mc.Supports("text/plain"))
506 assert.True(t, mc.Supports("text/markdown"))
507}
508
509func TestLoadCaps_ModelNotFound(t *testing.T) {
510 t.Parallel()

Callers

nothing calls this directly

Calls 5

NewDatabaseStoreFunction · 0.92
NewIDFunction · 0.92
LoadCapsFunction · 0.85
ContextMethod · 0.80
SupportsMethod · 0.80

Tested by

no test coverage detected