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

Function NewAIProviderBedrockSettings

codersdk/aiproviders_bedrock.go:64–77  ·  view source on GitHub ↗

NewAIProviderBedrockSettings builds an AIProviderBedrockSettings, promoting non-empty credential strings to pointers so callers don't have to repeat the "set field iff non-empty" boilerplate. Empty credentials are left nil, matching the PATCH-omit semantics of the pointer-typed fields.

(region, accessKey, accessKeySecret, model, smallFastModel string)

Source from the content-addressed store, hash-verified

62// credentials are left nil, matching the PATCH-omit semantics of the
63// pointer-typed fields.
64func NewAIProviderBedrockSettings(region, accessKey, accessKeySecret, model, smallFastModel string) AIProviderBedrockSettings {
65 s := AIProviderBedrockSettings{
66 Region: region,
67 Model: model,
68 SmallFastModel: smallFastModel,
69 }
70 if accessKey != "" {
71 s.AccessKey = &accessKey
72 }
73 if accessKeySecret != "" {
74 s.AccessKeySecret = &accessKeySecret
75 }
76 return s
77}
78
79// IsBedrockConfigured reports whether the combination of the parent
80// provider's BaseURL and AIProviderBedrockSettings indicates a Bedrock

Callers 3

providersFromEnvFunction · 0.92
ReadAIProvidersFromEnvFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected