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

Function AIProviderSettings

coderd/database/db2sdk/db2sdk.go:79–88  ·  view source on GitHub ↗

AIProviderSettings parses the on-disk JSON form back into a codersdk settings value. SQL NULL and the empty string decode to the zero value.

(col sql.NullString)

Source from the content-addressed store, hash-verified

77// settings value. SQL NULL and the empty string decode to the zero
78// value.
79func AIProviderSettings(col sql.NullString) (codersdk.AIProviderSettings, error) {
80 if !col.Valid || col.String == "" {
81 return codersdk.AIProviderSettings{}, nil
82 }
83 var s codersdk.AIProviderSettings
84 if err := json.Unmarshal([]byte(col.String), &s); err != nil {
85 return codersdk.AIProviderSettings{}, err
86 }
87 return s, nil
88}
89
90// maskAIProviderKeys converts the supplied database rows into the
91// public-facing AIProviderKey shape, preserving order. Plaintext is

Callers 6

SeedAIProvidersFromEnvFunction · 0.92
aiProvidersUpdateMethod · 0.92
buildAIProviderFromRowFunction · 0.92
AIProviderFunction · 0.70

Calls 1

UnmarshalMethod · 0.45

Tested by 1