import { AiGatewayCredentials, t as AiGatewayCredentials_d_exports } from "./AiGatewayCredentials.js"; import { AnthropicClient } from "@effect/ai-anthropic"; import { Effect, Layer } from "effect"; import { HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/http"; //#region src/AiGateway.d.ts /** Base URL of the Vercel AI Gateway. */ export declare const AI_GATEWAY_URL = "https://ai-gateway.vercel.sh"; /** * Builds the Anthropic client against the gateway, authenticating each * request with `credentials`. A credential failure fails that request as an * `HttpClientError`, which Effect AI surfaces as a network `AiError`. */ export declare const make: (credentials: typeof AiGatewayCredentials.Service) => Effect.Effect; /** * `AnthropicClient` backed by the gateway, authenticating with the * `AiGatewayCredentials` you provide (see that module's `layerFrom*` layers). * Needs an `HttpClient` too. */ export declare const layerWithoutCredentials: Layer.Layer; /** * `layerWithoutCredentials` with the default `AiGatewayCredentials.layer`: * `AI_GATEWAY_API_KEY`, else the Vercel OIDC token. Needs an `HttpClient`. * Building never fails; without a usable credential, the requests fail. */ export declare const layer: Layer.Layer; /** * The Effect provider writes `"cache_control": null` on every content block * it has no cache setting for. Anthropic accepts that; the gateway rejects * the request with `messages.0.content: Invalid input`. Remove the null keys. */ export declare function dropNullCacheControl(request: HttpClientRequest.HttpClientRequest): HttpClientRequest.HttpClientRequest; /** * The gateway's Anthropic-shaped responses leave out keys that Anthropic * always sends and the Effect provider's schema requires: the cache and * service-tier usage fields, the `signature` of a thinking block from a * non-Anthropic model, and `type`/`request_id` on error envelopes, whose * `error.type` may also be a gateway-specific value. Fill them with the values * Anthropic uses when there is nothing to report. Streaming responses are not * JSON and pass through untouched. */ export declare function fillMissingResponseKeys(response: HttpClientResponse.HttpClientResponse): Effect.Effect; export declare function patchResponseBody(body: Record): Record; //#endregion //# sourceMappingURL=AiGateway.d.ts.map