MCPcopy Index your code
hub / github.com/Effect-TS/effect / layerConfig

Function layerConfig

packages/ai/amazon-bedrock/src/AmazonBedrockClient.ts:217–234  ·  view source on GitHub ↗
(
  options: {
    readonly apiUrl?: Config.Config<string> | undefined
    readonly accessKeyId: Config.Config<string>
    readonly secretAccessKey: Config.Config<Redacted.Redacted>
    readonly sessionToken?: Config.Config<Redacted.Redacted> | undefined
    readonly region?: Config.Config<string> | undefined
    readonly transformClient?: (
      client: HttpClient.HttpClient
    ) => HttpClient.HttpClient
  }
)

Source from the content-addressed store, hash-verified

215 * @category layers
216 */
217export 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

Callers

nothing calls this directly

Calls 2

makeFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected