MCPcopy Index your code
hub / github.com/coder/coder / buildAIProviderKeyPool

Function buildAIProviderKeyPool

cli/aibridged.go:317–323  ·  view source on GitHub ↗

buildAIProviderKeyPool builds a [keypool.Pool]. Callers must check len(keys) > 0 first; keypool.New rejects empty input.

(keys []database.AIProviderKey)

Source from the content-addressed store, hash-verified

315// buildAIProviderKeyPool builds a [keypool.Pool]. Callers must check
316// len(keys) > 0 first; keypool.New rejects empty input.
317func buildAIProviderKeyPool(keys []database.AIProviderKey) (*keypool.Pool, error) {
318 raw := make([]string, 0, len(keys))
319 for _, k := range keys {
320 raw = append(raw, k.APIKey)
321 }
322 return keypool.New(raw, quartz.NewReal())
323}
324
325// bedrockConfigFromRow returns nil when the settings have no Bedrock
326// discriminator or when the Bedrock fields are not actually configured.

Callers 1

buildAIProviderFromRowFunction · 0.85

Calls 1

NewFunction · 0.92

Tested by

no test coverage detected