import { EmbeddingModelV3, EmbeddingModelV3CallOptions, EmbeddingModelV3Result, LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult, ProviderV3 } from '@ai-sdk/provider';
import { DeploymentIdConfig, ResourceGroupConfig } from '@sap-ai-sdk/ai-api/internal.js';
import { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
import { AzureOpenAiChatCompletionParameters } from '@sap-ai-sdk/foundation-models';
import { FilteringModule, GroundingModule, MaskingModule, ChatCompletionTool, TranslationModule, ChatModel } from '@sap-ai-sdk/orchestration';
export { AssistantChatMessage, ChatCompletionRequest, ChatCompletionTool, ChatMessage, DeveloperChatMessage, DocumentTranslationApplyToSelector, FilteringModule, FunctionObject, GroundingModule, LlmModelDetails, LlmModelParams, MaskingModule, OrchestrationClient, OrchestrationConfigRef, OrchestrationEmbeddingClient, OrchestrationEmbeddingResponse, OrchestrationErrorResponse, OrchestrationModuleConfig, OrchestrationResponse, OrchestrationStream, OrchestrationStreamChunkResponse, OrchestrationStreamResponse, PromptTemplatingModule, SystemChatMessage, ToolChatMessage, TranslationApplyToCategory, TranslationInputParameters, TranslationModule, TranslationOutputParameters, TranslationTargetLanguage, UserChatMessage, buildAzureContentSafetyFilter, buildDocumentGroundingConfig, buildDpiMaskingProvider, buildLlamaGuard38BFilter, buildTranslationConfig } from '@sap-ai-sdk/orchestration';
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
import { InferSchema } from '@ai-sdk/provider-utils';

/**
 * Escapes template delimiters (`{{`, `{%`, `{#`) by inserting zero-width spaces.
 * @param text - The text content to escape.
 * @returns Text with delimiters escaped (e.g., `{{` → `{\u200B{`).
 */
declare function escapeOrchestrationPlaceholders(text: string): string;
/**
 * Reverses escaping by removing zero-width spaces from template delimiters.
 * @param text - The escaped text content.
 * @returns Original text with `{{`, `{%`, `{#` restored.
 */
declare function unescapeOrchestrationPlaceholders(text: string): string;

/**
 * Azure OpenAI chat extension configuration for "On Your Data" scenarios.
 * Extracted directly from the SDK's AzureOpenAiChatCompletionParameters type.
 *
 * Supports Azure AI Search, Azure Cosmos DB, and other data sources for RAG scenarios.
 * @see https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data
 */
type AzureOpenAiChatExtensionConfiguration = NonNullable<AzureOpenAiChatCompletionParameters["data_sources"]>[number];
/**
 * Common model parameters shared between both APIs.
 * These parameters are supported by both Orchestration and Foundation Models APIs.
 * Includes index signature for compatibility with deep merge utilities.
 */
interface CommonModelParams {
    /** Frequency penalty between -2.0 and 2.0. */
    readonly frequencyPenalty?: number;
    /** Maximum number of tokens to generate. */
    readonly maxTokens?: number;
    /** Number of completions to generate (not supported by Amazon/Anthropic). */
    readonly n?: number;
    /** Whether to enable parallel tool calls. */
    readonly parallel_tool_calls?: boolean;
    /** Presence penalty between -2.0 and 2.0. */
    readonly presencePenalty?: number;
    /** Index signature for compatibility with Record<string, unknown>. */
    readonly [key: string]: unknown;
    /** Sampling temperature between 0 and 2. */
    readonly temperature?: number;
    /** Nucleus sampling parameter between 0 and 1. */
    readonly topP?: number;
}
/**
 * Default settings configuration when using Foundation Models API.
 * Used for type-safe provider defaultSettings with Foundation Models API.
 */
interface FoundationModelsDefaultSettings {
    /** API type - required discriminant for Foundation Models. */
    readonly api: "foundation-models";
    /** Default model settings for Foundation Models API. */
    readonly settings?: FoundationModelsModelSettings;
}
/**
 * Model parameters for Foundation Models Embedding API.
 * These parameters are specific to embedding operations.
 */
interface FoundationModelsEmbeddingParams {
    /** The number of dimensions the resulting output embeddings should have. */
    readonly dimensions?: number;
    /** The format to return the embeddings in. */
    readonly encoding_format?: "base64" | "float";
    /** A unique identifier representing your end-user for abuse monitoring. */
    readonly user?: string;
}
/**
 * Model parameters for Foundation Models API.
 * Includes additional Azure OpenAI-specific parameters not available in Orchestration.
 *
 * These parameters map directly to AzureOpenAiChatCompletionParameters from the SDK.
 */
interface FoundationModelsModelParams extends CommonModelParams {
    /** Modifies likelihood of specified tokens appearing in completion. Maps to SDK's logit_bias. */
    readonly logit_bias?: AzureOpenAiChatCompletionParameters["logit_bias"];
    /** Whether to return log probabilities of output tokens. Maps to SDK's logprobs. */
    readonly logprobs?: AzureOpenAiChatCompletionParameters["logprobs"];
    /** Random seed for deterministic sampling. Maps to SDK's seed. */
    readonly seed?: AzureOpenAiChatCompletionParameters["seed"];
    /** Stop sequences where the API will stop generating further tokens. Maps to SDK's stop. */
    readonly stop?: AzureOpenAiChatCompletionParameters["stop"];
    /** Number of most likely tokens to return at each position (requires logprobs=true). Maps to SDK's top_logprobs. */
    readonly top_logprobs?: AzureOpenAiChatCompletionParameters["top_logprobs"];
    /** A unique identifier representing your end-user for abuse monitoring. Maps to SDK's user. */
    readonly user?: AzureOpenAiChatCompletionParameters["user"];
}
/**
 * Model settings when using Foundation Models API.
 * Includes Foundation Models-only features: dataSources.
 */
interface FoundationModelsModelSettings {
    /** API type - required discriminant for Foundation Models. */
    readonly api: "foundation-models";
    /**
     * Azure OpenAI "On Your Data" configuration for chat extensions.
     * Enables RAG scenarios with Azure AI Search, Cosmos DB, etc.
     *
     * Type extracted from SDK's AzureOpenAiChatCompletionParameters["data_sources"].
     */
    readonly dataSources?: AzureOpenAiChatExtensionConfiguration[];
    /**
     * Whether to include assistant reasoning parts in the response.
     * @default false
     */
    readonly includeReasoning?: boolean;
    /** Model generation parameters that control the output. */
    readonly modelParams?: FoundationModelsModelParams;
    /** Specific version of the model to use. */
    readonly modelVersion?: string;
    /** Response format for structured output (OpenAI-compatible). */
    readonly responseFormat?: ResponseFormat;
}
/**
 * Default settings configuration when using Orchestration API.
 * Used for type-safe provider defaultSettings with Orchestration API.
 */
interface OrchestrationDefaultSettings {
    /** API type - optional, defaults to 'orchestration'. */
    readonly api?: "orchestration";
    /** Default model settings for Orchestration API. */
    readonly settings?: OrchestrationModelSettings;
}
/**
 * Model parameters for Orchestration API.
 * Currently same as CommonModelParams - no additional params exposed by SAP SDK.
 */
type OrchestrationModelParams = CommonModelParams;
/**
 * Model settings when using Orchestration API.
 * Includes all orchestration-only features: filtering, grounding, masking, translation.
 */
interface OrchestrationModelSettings {
    /** API type - optional, defaults to 'orchestration'. */
    readonly api?: "orchestration";
    /**
     * Escape template delimiters (`{{`, `{%`, `{#`) to prevent SAP orchestration template conflicts.
     * @default true
     */
    readonly escapeTemplatePlaceholders?: boolean;
    /** Filtering configuration for input and output content safety. */
    readonly filtering?: FilteringModule;
    /** Grounding module configuration for document-based retrieval (RAG). */
    readonly grounding?: GroundingModule;
    /**
     * Whether to include assistant reasoning parts in the response.
     * @default false
     */
    readonly includeReasoning?: boolean;
    /** Masking configuration for data anonymization/pseudonymization via SAP DPI. */
    readonly masking?: MaskingModule;
    /** Model generation parameters that control the output. */
    readonly modelParams?: OrchestrationModelParams;
    /** Specific version of the model to use. */
    readonly modelVersion?: string;
    /** Response format for structured output (OpenAI-compatible). */
    readonly responseFormat?: ResponseFormat;
    /** Tool definitions in SAP AI SDK format. */
    readonly tools?: ChatCompletionTool[];
    /** Translation module configuration for input/output translation. */
    readonly translation?: TranslationModule;
}
/**
 * Response format for structured output (OpenAI-compatible).
 * Extracted directly from the SDK's AzureOpenAiChatCompletionParameters type.
 *
 * Supports:
 * - `{ type: "text" }` - Default text response
 * - `{ type: "json_object" }` - JSON mode
 * - `{ type: "json_schema", json_schema: {...} }` - Structured outputs with schema validation
 */
type ResponseFormat = AzureOpenAiChatCompletionParameters["response_format"];
/**
 * Supported API types for SAP AI Core.
 * - `'orchestration'`: Uses SAP AI Core Orchestration API (default) - supports filtering, grounding, masking, translation
 * - `'foundation-models'`: Uses SAP AI Core Foundation Models API - supports dataSources, logprobs, seed, etc.
 */
type SAPAIApiType = "foundation-models" | "orchestration";
/**
 * Union type for API-specific default settings configuration.
 */
type SAPAIDefaultSettingsConfig = FoundationModelsDefaultSettings | OrchestrationDefaultSettings;
/**
 * Settings for the SAP AI Embedding Model.
 */
interface SAPAIEmbeddingSettings {
    /**
     * SAP AI Core API to use for this model.
     * Overrides provider-level API setting. Can be further overridden per-call via providerOptions.
     * - `'orchestration'` (default): SAP AI Core Orchestration API
     * - `'foundation-models'`: SAP AI Core Foundation Models API
     */
    readonly api?: SAPAIApiType;
    /**
     * Maximum number of embeddings per API call.
     * @default 2048
     */
    readonly maxEmbeddingsPerCall?: number;
    /**
     * Additional model parameters passed to the embedding API.
     * For Orchestration API, this is EmbeddingModelParams from `@sap-ai-sdk/orchestration`.
     * For Foundation Models API, this is FoundationModelsEmbeddingParams.
     */
    readonly modelParams?: FoundationModelsEmbeddingParams | Record<string, unknown>;
    /** Specific version of the model to use. */
    readonly modelVersion?: string;
    /** Index signature for compatibility with Record<string, unknown>. */
    readonly [key: string]: unknown;
    /**
     * Embedding task type.
     * @default 'text'
     */
    readonly type?: "document" | "query" | "text";
}
/**
 * Supported model IDs in SAP AI Core.
 * Actual availability depends on your SAP AI Core tenant configuration.
 */
type SAPAIModelId = ChatModel;
/**
 * Union type for model settings - supports both APIs.
 */
type SAPAIModelSettings = FoundationModelsModelSettings | OrchestrationModelSettings;

/**
 * Settings for configuring SAP AI Core model behavior.
 * Controls model parameters, data masking, content filtering, and tool usage.
 *
 * This is the legacy settings interface maintained for backward compatibility.
 * For new code, prefer using OrchestrationModelSettings or FoundationModelsModelSettings
 * which provide API-specific type safety.
 */
interface SAPAISettings {
    /**
     * SAP AI Core API to use for this model.
     * Overrides provider-level API setting. Can be further overridden per-call via providerOptions.
     * - `'orchestration'` (default): SAP AI Core Orchestration API
     * - `'foundation-models'`: SAP AI Core Foundation Models API
     */
    readonly api?: SAPAIApiType;
    /**
     * Escape template delimiters (`\{\{`, `\{%`, `\{#`) to prevent SAP orchestration template conflicts.
     * @default true
     */
    readonly escapeTemplatePlaceholders?: boolean;
    /** Filtering configuration for input and output content safety. */
    readonly filtering?: FilteringModule;
    /** Grounding module configuration for document-based retrieval (RAG). */
    readonly grounding?: GroundingModule;
    /**
     * Whether to include assistant reasoning parts in the response.
     * @default false
     */
    readonly includeReasoning?: boolean;
    /** Masking configuration for data anonymization/pseudonymization via SAP DPI. */
    readonly masking?: MaskingModule;
    /** Model generation parameters that control the output. */
    readonly modelParams?: CommonModelParams;
    /** Specific version of the model to use. */
    readonly modelVersion?: string;
    /** Response format for structured output (OpenAI-compatible). */
    readonly responseFormat?: ResponseFormat;
    /** Tool definitions in SAP AI SDK format. */
    readonly tools?: ChatCompletionTool[];
    /** Translation module configuration for input/output translation. */
    readonly translation?: TranslationModule;
}

/**
 * SAP AI Embedding Model - Vercel AI SDK EmbeddingModelV3 implementation for SAP AI Core.
 *
 * This is a thin wrapper that delegates to API-specific strategies (Orchestration or Foundation Models).
 * Strategy selection happens at invocation time using the late-binding pattern.
 * @module sap-ai-embedding-model
 */

/** Model identifier for SAP AI embedding models (e.g., 'text-embedding-ada-002'). */
type SAPAIEmbeddingModelId = string;
/**
 * Internal configuration for SAP AI Embedding Model.
 * @internal
 */
interface SAPAIEmbeddingModelConfig {
    readonly deploymentConfig: DeploymentIdConfig | ResourceGroupConfig;
    readonly destination?: HttpDestinationOrFetchOptions;
    readonly provider: string;
    /** Provider-level API setting for fallback during API resolution. */
    readonly providerApi?: SAPAIApiType;
}
/**
 * SAP AI Core Embedding Model implementing Vercel AI SDK EmbeddingModelV3.
 *
 * This class is a thin wrapper that delegates to API-specific strategies:
 * - Orchestration API: uses OrchestrationEmbeddingClient
 * - Foundation Models API: uses AzureOpenAiEmbeddingClient
 * @example
 * ```typescript
 * const { embedding } = await embed({
 *   model: provider.embedding('text-embedding-ada-002'),
 *   value: 'Hello, world!'
 * });
 * ```
 */
declare class SAPAIEmbeddingModel implements EmbeddingModelV3 {
    /** Maximum number of embeddings per API call. */
    readonly maxEmbeddingsPerCall: number;
    /** The model identifier. */
    readonly modelId: string;
    /** The provider identifier string. */
    readonly provider: string;
    /** The Vercel AI SDK specification version. */
    readonly specificationVersion: "v3";
    /** Whether the model supports parallel API calls. */
    readonly supportsParallelCalls: boolean;
    private readonly config;
    private readonly settings;
    /**
     * Creates a new SAP AI Embedding Model instance.
     *
     * This is the main implementation that handles all SAP AI Core embedding logic.
     * @param modelId - The model identifier (e.g., 'text-embedding-ada-002', 'text-embedding-3-small').
     * @param settings - Model configuration settings (embedding type, model parameters, etc.).
     * @param config - SAP AI Core deployment and destination configuration.
     */
    constructor(modelId: SAPAIEmbeddingModelId, settings: SAPAIEmbeddingSettings | undefined, config: SAPAIEmbeddingModelConfig);
    /**
     * Generates embeddings for the given input values.
     *
     * Implements late-binding: resolves API at invocation time, validates settings,
     * gets the appropriate strategy, and delegates the call.
     * @param options - The Vercel AI SDK V3 embedding call options.
     * @returns The embedding result with vectors, usage data, and warnings.
     */
    doEmbed(options: EmbeddingModelV3CallOptions): Promise<EmbeddingModelV3Result>;
}

/**
 * Error conversion utilities for SAP AI Core to Vercel AI SDK error types.
 */

/**
 * Error thrown when attempting to switch APIs at invocation time with conflicting model settings.
 *
 * This error occurs when:
 * - A model was created with API-specific features (e.g., filtering for Orchestration)
 * - An attempt is made to switch to a different API at invocation time via providerOptions
 * - The model's configured features are incompatible with the target API
 * @example
 * ```typescript
 * // Model configured with filtering (Orchestration-only)
 * const model = provider("gpt-4o", { filtering: { ... } });
 *
 * // Attempt to switch to Foundation Models at invocation time
 * import { SAP_AI_PROVIDER_NAME } from "@jerome-benoit/sap-ai-provider";
 *
 * await generateText({
 *   model,
 *   providerOptions: { [SAP_AI_PROVIDER_NAME]: { api: "foundation-models" } },
 *   prompt: "Hello",
 * });
 * // Throws: ApiSwitchError("orchestration", "foundation-models", "filtering")
 * ```
 */
declare class ApiSwitchError extends Error {
    readonly fromApi: SAPAIApiType;
    readonly toApi: SAPAIApiType;
    readonly conflictingFeature: string;
    /**
     * Creates a new ApiSwitchError.
     * @param fromApi - The API the model was configured with.
     * @param toApi - The API being switched to at invocation time.
     * @param conflictingFeature - The feature that prevents the API switch.
     */
    constructor(fromApi: SAPAIApiType, toApi: SAPAIApiType, conflictingFeature: string);
}
/**
 * Error thrown when a feature is used with an incompatible API.
 * @example
 * ```typescript
 * // Thrown when using content filtering with Foundation Models API
 * throw new UnsupportedFeatureError("Content filtering", "foundation-models", "orchestration");
 * // Error message: "Content filtering is not supported with Foundation Models API. Use Orchestration API instead."
 * ```
 */
declare class UnsupportedFeatureError extends Error {
    readonly feature: string;
    readonly api: SAPAIApiType;
    readonly suggestedApi: SAPAIApiType;
    /**
     * Creates a new UnsupportedFeatureError.
     * @param feature - The name of the unsupported feature (e.g., "Content filtering").
     * @param api - The API being used where the feature is not supported.
     * @param suggestedApi - The API that supports this feature.
     */
    constructor(feature: string, api: SAPAIApiType, suggestedApi: SAPAIApiType);
}

/**
 * Internal configuration for SAP AI Language Model.
 * @internal
 */
interface SAPAILanguageModelConfig {
    readonly deploymentConfig: DeploymentIdConfig | ResourceGroupConfig;
    readonly destination?: HttpDestinationOrFetchOptions;
    readonly provider: string;
    /** Provider-level API setting for fallback during API resolution. */
    readonly providerApi?: SAPAIApiType;
}
/**
 * SAP AI Language Model implementing Vercel AI SDK LanguageModelV3.
 *
 * Features: text generation, tool calling, multi-modal input, data masking, content filtering.
 * Supports: Azure OpenAI, Google Vertex AI, AWS Bedrock, AI Core open source models.
 *
 * This class is a thin wrapper that delegates to API-specific strategies:
 * - Orchestration API: filtering, grounding, masking, translation, SAP-format tools
 * - Foundation Models API: dataSources (Azure On Your Data), logprobs, seed, etc.
 */
declare class SAPAILanguageModel implements LanguageModelV3 {
    /** The model identifier. */
    readonly modelId: SAPAIModelId;
    /** The Vercel AI SDK specification version. */
    readonly specificationVersion = "v3";
    /** Whether the model supports image URLs in prompts. */
    readonly supportsImageUrls: boolean;
    /** Whether the model supports generating multiple completions. */
    readonly supportsMultipleCompletions: boolean;
    /** Whether the model supports parallel tool calls. */
    readonly supportsParallelToolCalls: boolean;
    /** Whether the model supports streaming responses. */
    readonly supportsStreaming: boolean;
    /** Whether the model supports structured JSON outputs. */
    readonly supportsStructuredOutputs: boolean;
    /** Whether the model supports tool/function calling. */
    readonly supportsToolCalls: boolean;
    /**
     * Gets the provider identifier string.
     * @returns The provider identifier.
     */
    get provider(): string;
    /**
     * Gets the supported URL patterns for image input.
     * @returns A mapping of MIME type patterns to URL regex patterns.
     */
    get supportedUrls(): Record<string, RegExp[]>;
    /** @internal */
    private readonly config;
    /** @internal */
    private readonly settings;
    /**
     * Creates a new SAP AI Language Model instance.
     *
     * This is the main implementation that handles all SAP AI Core orchestration logic.
     * @param modelId - The model identifier (e.g., 'gpt-4o', 'claude-3-5-sonnet', 'gemini-2.0-flash').
     * @param settings - Model configuration settings (temperature, max tokens, filtering, etc.).
     * @param config - SAP AI Core deployment and destination configuration.
     * @internal
     */
    constructor(modelId: SAPAIModelId, settings: SAPAISettings, config: SAPAILanguageModelConfig);
    /**
     * Generates a single completion (non-streaming).
     *
     * Implements late-binding: resolves API at invocation time, validates settings,
     * gets the appropriate strategy, and delegates the call.
     * Supports request cancellation via AbortSignal at the HTTP transport layer.
     * @param options - The Vercel AI SDK V3 generation call options.
     * @returns The generation result with content, usage, warnings, and provider metadata.
     */
    doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
    /**
     * Generates a streaming completion.
     *
     * Implements late-binding: resolves API at invocation time, validates settings,
     * gets the appropriate strategy, and delegates the call.
     * Supports request cancellation via AbortSignal at the HTTP transport layer.
     * @param options - The Vercel AI SDK V3 generation call options.
     * @returns A stream result with async iterable stream parts.
     */
    doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
    /**
     * Checks if a URL is supported for image input (HTTPS or data:image/*).
     * @param url - The URL to check.
     * @returns True if the URL is supported for image input.
     */
    supportsUrl(url: URL): boolean;
}

/** Default provider name used as key in `providerOptions` and `providerMetadata` objects. */
declare const SAP_AI_PROVIDER_NAME: "sap-ai";
/**
 * Extracts the provider name from a provider identifier (e.g., "sap-ai.chat" → "sap-ai").
 * @param providerIdentifier - The full provider identifier string.
 * @returns The provider name without any suffix.
 */
declare function getProviderName(providerIdentifier: string): string;
/** Zod schema for SAP AI language model provider options passed via `providerOptions['sap-ai']` object. */
declare const sapAILanguageModelProviderOptions: _ai_sdk_provider_utils.LazySchema<{
    api?: "foundation-models" | "orchestration" | undefined;
    escapeTemplatePlaceholders?: boolean | undefined;
    includeReasoning?: boolean | undefined;
    modelParams?: {
        [x: string]: unknown;
        frequencyPenalty?: number | undefined;
        maxTokens?: number | undefined;
        n?: number | undefined;
        parallel_tool_calls?: boolean | undefined;
        presencePenalty?: number | undefined;
        temperature?: number | undefined;
        topP?: number | undefined;
    } | undefined;
}>;
/** SAP AI language model provider options type inferred from Zod schema. */
type SAPAILanguageModelProviderOptions = InferSchema<typeof sapAILanguageModelProviderOptions>;
/** Zod schema for SAP AI embedding model provider options passed via `providerOptions['sap-ai']` object. */
declare const sapAIEmbeddingProviderOptions: _ai_sdk_provider_utils.LazySchema<{
    api?: "foundation-models" | "orchestration" | undefined;
    modelParams?: {
        [x: string]: unknown;
        dimensions?: number | undefined;
        encoding_format?: "base64" | "binary" | "float" | undefined;
        normalize?: boolean | undefined;
    } | undefined;
    type?: "text" | "document" | "query" | undefined;
}>;
/** SAP AI embedding model provider options type inferred from Zod schema. */
type SAPAIEmbeddingProviderOptions = InferSchema<typeof sapAIEmbeddingProviderOptions>;

/** Deployment configuration type used by the SAP AI SDK. */
type DeploymentConfig = DeploymentIdConfig | ResourceGroupConfig;
/**
 * SAP AI Provider interface for creating and configuring SAP AI Core models.
 * Extends the Vercel AI SDK ProviderV3 interface with SAP-specific functionality.
 */
interface SAPAIProvider extends ProviderV3 {
    /** Creates a language model instance. */
    (modelId: SAPAIModelId, settings?: SAPAISettings): SAPAILanguageModel;
    /** Creates a language model instance (custom convenience method). */
    chat(modelId: SAPAIModelId, settings?: SAPAISettings): SAPAILanguageModel;
    /** Creates an embedding model instance (custom convenience method). */
    embedding(modelId: SAPAIEmbeddingModelId, settings?: SAPAIEmbeddingSettings): SAPAIEmbeddingModel;
    /** Creates an embedding model instance (Vercel AI SDK ProviderV3 standard method). */
    embeddingModel(modelId: SAPAIEmbeddingModelId, settings?: SAPAIEmbeddingSettings): SAPAIEmbeddingModel;
    /**
     * Image model stub - always throws NoSuchModelError.
     * SAP AI Core does not support image generation.
     */
    imageModel(modelId: string): never;
    /** Creates a language model instance (Vercel AI SDK ProviderV3 standard method). */
    languageModel(modelId: SAPAIModelId, settings?: SAPAISettings): SAPAILanguageModel;
    /**
     * Creates a text embedding model instance.
     * @deprecated Use `embeddingModel()` instead.
     */
    textEmbeddingModel(modelId: SAPAIEmbeddingModelId, settings?: SAPAIEmbeddingSettings): SAPAIEmbeddingModel;
}
/**
 * Configuration settings for the SAP AI Provider.
 * See {@link createSAPAIProvider} for authentication details.
 */
interface SAPAIProviderSettings {
    /**
     * SAP AI Core API to use for all models created by this provider.
     * Can be overridden at model creation time or per-call via providerOptions.
     * - `'orchestration'` (default): SAP AI Core Orchestration API - supports filtering, grounding, masking, translation
     * - `'foundation-models'`: SAP AI Core Foundation Models API - supports dataSources, logprobs, seed, etc.
     * @default 'orchestration'
     */
    readonly api?: SAPAIApiType;
    /** Default model settings applied to every model instance. Per-call settings override these. */
    readonly defaultSettings?: SAPAISettings;
    /** SAP AI Core deployment ID. If not provided, the SDK resolves deployment automatically. */
    readonly deploymentId?: string;
    /** Custom destination configuration for SAP AI Core. */
    readonly destination?: HttpDestinationOrFetchOptions;
    /**
     * Log level for SAP Cloud SDK loggers.
     * Controls verbosity of internal SAP SDK logging (e.g., authentication, service binding).
     * Note: SAP_CLOUD_SDK_LOG_LEVEL environment variable takes precedence if set.
     * @default 'warn'
     */
    readonly logLevel?: "debug" | "error" | "info" | "warn";
    /**
     * Provider name used as key for `providerOptions` and `providerMetadata`.
     * @default 'sap-ai'
     */
    readonly name?: string;
    /**
     * SAP AI Core resource group for resource isolation and access control.
     * @default 'default'
     */
    readonly resourceGroup?: string;
    /** Whether to emit warnings for ambiguous configurations (e.g. both deploymentId and resourceGroup). */
    readonly warnOnAmbiguousConfig?: boolean;
}
/**
 * Creates a SAP AI Core provider instance for use with the Vercel AI SDK.
 *
 * Uses the official SAP AI SDK (`@sap-ai-sdk/orchestration` and
 * `@sap-ai-sdk/foundation-models`) for API communication. Authentication is automatic via service binding
 * (VCAP_SERVICES on SAP BTP) or AICORE_SERVICE_KEY environment variable.
 * @param options - Provider configuration options.
 * @returns A configured SAP AI provider instance.
 */
declare function createSAPAIProvider(options?: SAPAIProviderSettings): SAPAIProvider;
/** Default SAP AI provider instance with automatic authentication via SAP AI SDK. */
declare const sapai: SAPAIProvider;

/**
 * Validation functions for SAP AI API-specific features.
 *
 * Ensures that API-specific options are used correctly and provides clear error messages
 * for API-specific feature misconfigurations.
 */

/**
 * Options for the main validation function.
 */
interface ValidateSettingsOptions {
    /** The resolved API type to use */
    readonly api: SAPAIApiType;
    /** Invocation-time settings (per-call overrides) */
    readonly invocationSettings?: {
        readonly api?: SAPAIApiType;
        readonly escapeTemplatePlaceholders?: boolean;
    };
    /** The API the model was originally configured with (for switch detection) */
    readonly modelApi?: SAPAIApiType;
    /** Model-level settings (configured at model creation) */
    readonly modelSettings?: SAPAIModelSettings | SAPAISettings;
}
/**
 * Resolves the effective API type using the full precedence chain.
 *
 * Precedence (highest to lowest):
 * 1. Invocation-time override (providerOptions.api)
 * 2. Model-level setting (settings.api at model creation)
 * 3. Provider-level setting (createSAPAIProvider({ api }))
 * 4. System default ('orchestration')
 * @param providerApi - Provider-level API setting
 * @param modelApi - Model-level API setting
 * @param invocationApi - Invocation-time API override
 * @returns The resolved API type to use
 */
declare function resolveApi(providerApi: SAPAIApiType | undefined, modelApi: SAPAIApiType | undefined, invocationApi: SAPAIApiType | undefined): SAPAIApiType;
/**
 * Main validation function that performs all API-specific validations.
 * Call this before creating a strategy or making an API call.
 *
 * Validates:
 * 1. API input value is valid
 * 2. API switch is allowed (if invocation-time API differs from model API)
 * 3. API-specific options are compatible with selected API
 * 4. escapeTemplatePlaceholders is valid for selected API
 * @param options - Validation options including API, settings, and context
 * @throws {Error} If API value is invalid
 * @throws {ApiSwitchError} If API switch is not allowed due to conflicting features
 * @throws {UnsupportedFeatureError} If API-specific features are used with wrong API
 */
declare function validateSettings(options: ValidateSettingsOptions): void;

/**
 * Package version injected at build time via tsup define.
 * @module
 */
/** Current package version from package.json, injected at build time. */
declare const VERSION: string;

export { ApiSwitchError, type AzureOpenAiChatExtensionConfiguration, type CommonModelParams, type DeploymentConfig, type FoundationModelsDefaultSettings, type FoundationModelsEmbeddingParams, type FoundationModelsModelParams, type FoundationModelsModelSettings, type OrchestrationDefaultSettings, type OrchestrationModelParams, type OrchestrationModelSettings, type ResponseFormat, type SAPAIApiType, type SAPAIDefaultSettingsConfig, SAPAIEmbeddingModel, type SAPAIEmbeddingModelId, type SAPAIEmbeddingProviderOptions, type SAPAIEmbeddingSettings, SAPAILanguageModel, type SAPAILanguageModelProviderOptions, type SAPAIModelId, type SAPAIModelSettings, type SAPAIProvider, type SAPAIProviderSettings, type SAPAISettings, SAP_AI_PROVIDER_NAME, UnsupportedFeatureError, VERSION, createSAPAIProvider, escapeOrchestrationPlaceholders, getProviderName, resolveApi, sapAIEmbeddingProviderOptions, sapAILanguageModelProviderOptions, sapai, unescapeOrchestrationPlaceholders, validateSettings };
