buildAIProviderKeyPool builds a [keypool.Pool]. Callers must check len(keys) > 0 first; keypool.New rejects empty input.
(keys []database.AIProviderKey)
| 315 | // buildAIProviderKeyPool builds a [keypool.Pool]. Callers must check |
| 316 | // len(keys) > 0 first; keypool.New rejects empty input. |
| 317 | func 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. |
no test coverage detected