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

Function disabledProviderFromRow

cli/aibridged.go:311–313  ·  view source on GitHub ↗

disabledProviderFromRow builds a Provider stub for a disabled row. Using provider.DisabledStub rather than a concrete provider avoids duplicating the row.Type switch and ensures that a new AiProviderType value is automatically handled without requiring a matching case here.

(row database.AIProvider)

Source from the content-addressed store, hash-verified

309// duplicating the row.Type switch and ensures that a new AiProviderType
310// value is automatically handled without requiring a matching case here.
311func disabledProviderFromRow(row database.AIProvider) (aibridge.Provider, error) {
312 return aibridge.NewDisabledProviderStub(row.Name, string(row.Type)), nil
313}
314
315// buildAIProviderKeyPool builds a [keypool.Pool]. Callers must check
316// len(keys) > 0 first; keypool.New rejects empty input.

Callers 1

buildAIProviderFromRowFunction · 0.85

Calls 1

NewDisabledProviderStubFunction · 0.92

Tested by

no test coverage detected