| 215 | * @category layers |
| 216 | */ |
| 217 | export const layerConfig = ( |
| 218 | options: { |
| 219 | readonly apiUrl?: Config.Config<string> | undefined |
| 220 | readonly accessKeyId: Config.Config<string> |
| 221 | readonly secretAccessKey: Config.Config<Redacted.Redacted> |
| 222 | readonly sessionToken?: Config.Config<Redacted.Redacted> | undefined |
| 223 | readonly region?: Config.Config<string> | undefined |
| 224 | readonly transformClient?: ( |
| 225 | client: HttpClient.HttpClient |
| 226 | ) => HttpClient.HttpClient |
| 227 | } |
| 228 | ): Layer.Layer<AmazonBedrockClient, ConfigError, HttpClient.HttpClient> => { |
| 229 | const { transformClient, ...configs } = options |
| 230 | return Config.all(configs).pipe( |
| 231 | Effect.flatMap((configs) => make({ ...configs, transformClient })), |
| 232 | Layer.scoped(AmazonBedrockClient) |
| 233 | ) |
| 234 | } |
| 235 | |
| 236 | // ============================================================================= |
| 237 | // Client |