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)
| 62 | // credentials are left nil, matching the PATCH-omit semantics of the |
| 63 | // pointer-typed fields. |
| 64 | func 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 |
no outgoing calls
no test coverage detected