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

Function ProviderAPIKeyEnvVars

pkg/config/auto.go:166–180  ·  view source on GitHub ↗

ProviderAPIKeyEnvVars returns the deduplicated, sorted set of environment variables that hold a dedicated model-provider API key. Callers that need to forward provider credentials (e.g. into a container) should use this instead of hard-coding a list of API key names, so it stays in sync as providers

()

Source from the content-addressed store, hash-verified

164// and broad general-purpose tokens (see nonForwardableTokenEnvVars). Providers
165// needing those must be given credentials explicitly.
166func ProviderAPIKeyEnvVars() []string {
167 seen := map[string]bool{}
168 add := func(name string) {
169 if name != "" && !nonForwardableTokenEnvVars[name] {
170 seen[name] = true
171 }
172 }
173 for _, p := range cloudProviders {
174 add(p.apiKeyEnvVar)
175 }
176 for _, alias := range provider.EachAlias() {
177 add(alias.TokenEnvVar)
178 }
179 return slices.Sorted(maps.Keys(seen))
180}
181
182func AvailableProviders(ctx context.Context, modelsGateway string, env environment.Provider) []string {
183 if modelsGateway != "" {

Callers 2

Calls 2

EachAliasFunction · 0.92
KeysMethod · 0.45

Tested by 1