/** * Preview endpoint routing. * * Preview providers are not served by the production Conversational AI gateway. * They live behind a single partner host and are gated by an `agora-feature` * header. AgentSession detects preview providers from its resolved request body * and binds that session to the preview host while ordinary AgoraClient calls * remain on the regional production endpoint. * * Everything under `agentkit/preview/` is temporary. When a provider ships on * the production gateway, remove its preview registration and move its class * into the corresponding production vendor module. */ import type { AgoraClient } from "../../AgoraPoolClient.js"; import type * as Agora from "../../api/index.js"; import { AgentManagementClient } from "../../api/resources/agentManagement/client/Client.js"; import { AgentsClient } from "../../api/resources/agents/client/Client.js"; /** Base URL that serves the preview providers. */ export declare const PREVIEW_API_BASE_URL = "https://partner.ai.agora.io/preview/api/conversational-ai-agent"; /** * Request header that opts a request into a preview provider family. * * This is the header the preview gateway routes on. A request that reaches the * gateway without it is not rejected — it is routed to the production * environment, where the preview providers do not exist. */ export declare const PREVIEW_FEATURE_HEADER = "agora-feature"; /** * Preview provider families. Each value is one entry in the * {@link PREVIEW_FEATURE_HEADER} header and gates a set of vendors on the * preview endpoint. */ export declare const PreviewFeatures: { /** Gemini TTS preview gate; Gemini ASR and Live use production. */ readonly GeminiLive: "gemini-live"; /** @deprecated GPT Live now uses the production endpoint. */ readonly LiveModels: "live-models"; }; /** A preview provider family gate value. */ export type PreviewFeature = (typeof PreviewFeatures)[keyof typeof PreviewFeatures]; /** Session-scoped clients bound to one resolved route. */ export interface PreviewRoute { readonly agents: AgentsClient; readonly agentManagement: AgentManagementClient; readonly baseUrl: string; readonly features: readonly PreviewFeature[]; } /** * Pins the gate after any caller headers. This is also used for per-call auth * headers so a custom `agora-feature` value can never blank the session gate. */ export declare function previewRequestHeaders(features: readonly PreviewFeature[], headers?: Record): Record; /** Build generated resource clients for one preview session. */ export declare function createPreviewRoute(client: AgoraClient, features: readonly PreviewFeature[]): PreviewRoute; export declare function requiredPreviewFeatures(properties: Agora.StartAgentsRequest.Properties): PreviewFeature[]; /** * Normalizes the historical Gemini preview greeting field for production. * Kept under its old name so callers importing this compatibility helper do * not need to change code when moving an existing request to production. */ export declare function applyPreviewShape(properties: Agora.StartAgentsRequest.Properties): void;