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

Function layerConfig

packages/ai/google/src/GoogleClient.ts:220–246  ·  view source on GitHub ↗
(
  options: {
    /**
     * The API key to use to communicate with the Google Generative AI API.
     */
    readonly apiKey?: Config.Config<Redacted.Redacted | undefined> | undefined

    /**
     * The URL to use to communicate with the Google Generative AI API.
     *
     * Defaults to `"https://generativelanguage.googleapis.com/v1beta"`.
     */
    readonly apiUrl?: Config.Config<string | undefined> | undefined

    /**
     * A method which can be used to transform the underlying `HttpClient` which
     * will be used to communicate with the Google Generative AI API.
     */
    readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined
  }
)

Source from the content-addressed store, hash-verified

218 * @category Layers
219 */
220export const layerConfig = (
221 options: {
222 /**
223 * The API key to use to communicate with the Google Generative AI API.
224 */
225 readonly apiKey?: Config.Config<Redacted.Redacted | undefined> | undefined
226
227 /**
228 * The URL to use to communicate with the Google Generative AI API.
229 *
230 * Defaults to `"https://generativelanguage.googleapis.com/v1beta"`.
231 */
232 readonly apiUrl?: Config.Config<string | undefined> | undefined
233
234 /**
235 * A method which can be used to transform the underlying `HttpClient` which
236 * will be used to communicate with the Google Generative AI API.
237 */
238 readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined
239 }
240): Layer.Layer<GoogleClient, ConfigError, HttpClient.HttpClient> => {
241 const { transformClient, ...configs } = options
242 return Config.all(configs).pipe(
243 Effect.flatMap((configs) => make({ ...configs, transformClient })),
244 Layer.scoped(GoogleClient)
245 )
246}
247
248// =============================================================================
249// Utilities

Callers

nothing calls this directly

Calls 2

makeFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected