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

Function hasCustomBaseURL

pkg/config/model_alias.go:59–73  ·  view source on GitHub ↗

hasCustomBaseURL checks if a model config has a custom base_url, either directly or through a referenced provider definition.

(modelCfg *latest.ModelConfig, providers map[string]latest.ProviderConfig)

Source from the content-addressed store, hash-verified

57// hasCustomBaseURL checks if a model config has a custom base_url, either directly
58// or through a referenced provider definition.
59func hasCustomBaseURL(modelCfg *latest.ModelConfig, providers map[string]latest.ProviderConfig) bool {
60 // Check if the model has a direct base_url
61 if modelCfg.BaseURL != "" {
62 return true
63 }
64
65 // Check if the model references a provider with a base_url
66 if providers != nil && modelCfg.Provider != "" {
67 if providerCfg, exists := providers[modelCfg.Provider]; exists {
68 return providerCfg.BaseURL != ""
69 }
70 }
71
72 return false
73}

Callers 2

ResolveModelAliasesFunction · 0.85
TestHasCustomBaseURLFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestHasCustomBaseURLFunction · 0.68