import type { PhotonAIProviderConfig } from '../../types/photon-ai.types'; import { type PhotonAIProvider, type PhotonAIProviderRequest, type PhotonAIResponse } from './ai-provider.types'; /** * The single, provider-agnostic {@link PhotonAIProvider}. It is driven entirely * by a consumer-supplied {@link PhotonAIProviderConfig}: pick a hosted * {@link PhotonAIProviderType} for out-of-the-box defaults (endpoint, model, * auth, wire format), or override any field — up to and including the full * request/response wire format via `requestTransformer`/`responseTransformer` — * to talk to any JSON HTTP model endpoint. * * Uses the native `fetch` API only (no SDK), so it runs in every browser Photon * Grid supports. The API key is read from config at request time and applied * with the provider's auth scheme; it is never hard-coded, cached, or logged. * Every failure mode — HTTP errors, rate limits, auth problems, safety blocks, * timeouts, and malformed JSON — surfaces as a categorized * {@link PhotonAIProviderError}. */ export declare class HttpAIProvider implements PhotonAIProvider { private readonly type; private readonly preset; private readonly apiKey; private readonly apiUrl; private readonly model; private readonly headers; private readonly temperature; private readonly timeoutMs; private readonly transformRequest; private readonly transformResponse; constructor(config: PhotonAIProviderConfig); generate(request: PhotonAIProviderRequest): Promise; /** Resolves the final URL (auth-in-query for Gemini, plain otherwise). */ private buildUrl; /** Merges Content-Type + provider auth headers + consumer headers (consumer wins). */ private buildHeaders; /** POSTs the request as JSON, enforcing the configured timeout via `AbortController`. */ private fetchWithTimeout; /** Validates the HTTP status, mapping known failure statuses (auth, rate-limit) to categorized errors, and returns the parsed JSON body. */ private parseHttpResponse; /** Best-effort extraction of a provider error message from a non-2xx body (`{ error: { message } }` or `{ error: "..." }`). */ private readErrorMessage; } //# sourceMappingURL=http-ai-provider.d.ts.map