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 { EmbeddingModelParams, 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, OrchestrationErrorResponse, OrchestrationModuleConfig, OrchestrationResponse, OrchestrationStreamChunkResponse, OrchestrationStreamResponse, PromptTemplatingModule, SystemChatMessage, ToolChatMessage, TranslationApplyToCategory, TranslationInputParameters, TranslationModule, TranslationOutputParameters, TranslationTargetLanguage, UserChatMessage, buildAzureContentSafetyFilter, buildDocumentGroundingConfig, buildDpiMaskingProvider, buildLlamaGuard38BFilter, buildTranslationConfig, isConfigReference } from '@sap-ai-sdk/orchestration';
import { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
import { InferSchema } from '@ai-sdk/provider-utils';

/**
 * SAP AI Embedding Model implementation.
 *
 * This module provides an EmbeddingModelV3 implementation that bridges
 * the Vercel AI SDK with SAP AI Core's Orchestration API for generating
 * text embeddings using the official SAP AI SDK (@sap-ai-sdk/orchestration).
 * @module sap-ai-embedding-model
 */

/**
 * Model ID type for SAP AI embedding models.
 *
 * Common embedding models available in SAP AI Core:
 * - `text-embedding-ada-002` - OpenAI Ada v2
 * - `text-embedding-3-small` - OpenAI v3 small
 * - `text-embedding-3-large` - OpenAI v3 large
 */
type SAPAIEmbeddingModelId = string;
/**
 * Settings for the SAP AI Embedding Model.
 */
interface SAPAIEmbeddingSettings {
    /**
     * Maximum number of embeddings per API call.
     * @default 2048
     */
    readonly maxEmbeddingsPerCall?: number;
    /**
     * Additional model parameters passed to the embedding API.
     */
    readonly modelParams?: EmbeddingModelParams;
    /**
     * Embedding task type.
     * @default 'text'
     */
    readonly type?: "document" | "query" | "text";
}
/**
 * Internal configuration for the SAP AI Embedding Model.
 * @internal
 */
interface SAPAIEmbeddingConfig {
    readonly deploymentConfig: DeploymentIdConfig | ResourceGroupConfig;
    readonly destination?: HttpDestinationOrFetchOptions;
    readonly provider: string;
}
/**
 * SAP AI Core Embedding Model implementing the Vercel AI SDK EmbeddingModelV3 interface.
 *
 * This class wraps the SAP AI SDK's OrchestrationEmbeddingClient to provide
 * embedding generation capabilities compatible with the Vercel AI SDK.
 * @example
 * ```typescript
 * import { createSAPAIProvider } from '@mymediset/sap-ai-provider';
 * import { embed, embedMany } from 'ai';
 *
 * const provider = createSAPAIProvider();
 *
 * // Single embedding
 * const { embedding } = await embed({
 *   model: provider.embedding('text-embedding-ada-002'),
 *   value: 'Hello, world!'
 * });
 *
 * // Multiple embeddings
 * const { embeddings } = await embedMany({
 *   model: provider.embedding('text-embedding-3-small'),
 *   values: ['Hello', 'World', 'AI']
 * });
 * ```
 */
declare class SAPAIEmbeddingModel implements EmbeddingModelV3 {
    /**
     * Maximum number of embeddings that can be generated in a single API call.
     * @default 2048
     */
    readonly maxEmbeddingsPerCall: number;
    /**
     * The model ID.
     */
    readonly modelId: string;
    /**
     * The provider identifier.
     */
    readonly provider: string;
    /**
     * The embedding model interface version.
     */
    readonly specificationVersion: "v3";
    /**
     * Whether the model supports parallel calls.
     * Set to true as SAP AI Core can handle concurrent requests.
     */
    readonly supportsParallelCalls: boolean;
    private readonly config;
    private readonly settings;
    /**
     * Creates a new SAP AI Embedding Model instance.
     * @param modelId - The embedding model identifier (e.g., 'text-embedding-ada-002')
     * @param settings - Optional model settings
     * @param config - Internal configuration from the provider
     */
    constructor(modelId: SAPAIEmbeddingModelId, settings: SAPAIEmbeddingSettings | undefined, config: SAPAIEmbeddingConfig);
    /**
     * Generates embeddings for the given input values.
     *
     * This method implements the EmbeddingModelV3 interface and wraps
     * the SAP AI SDK's OrchestrationEmbeddingClient.
     * @param options - The embedding request options
     * @returns Promise resolving to embeddings and usage information
     * @since 1.0.0
     * @example
     * ```typescript
     * const result = await model.doEmbed({
     *   values: ['Hello, world!', 'How are you?']
     * });
     *
     * console.log(result.embeddings); // [[0.1, 0.2, ...], [0.3, 0.4, ...]]
     * console.log(result.usage?.tokens); // 10
     * ```
     */
    doEmbed(options: EmbeddingModelV3CallOptions): Promise<EmbeddingModelV3Result>;
    /**
     * Creates an OrchestrationEmbeddingClient with the current configuration.
     * @param perCallModelParams - Optional model params from per-call provider options
     * @returns Configured embedding client
     */
    private createClient;
    /**
     * Converts SAP embedding response to AI SDK format.
     * Handles both number array and base64-encoded string formats.
     * @param embedding - The embedding from SAP API (number[] or base64 string)
     * @returns Normalized embedding as number array
     */
    private normalizeEmbedding;
}

/**
 * The provider identifier used for provider options.
 * Use this key in `providerOptions` to pass SAP AI-specific options.
 * @example
 * ```typescript
 * providerOptions: {
 *   [SAP_AI_PROVIDER_NAME]: { includeReasoning: true }
 * }
 * ```
 */
declare const SAP_AI_PROVIDER_NAME: "sap-ai";
/**
 * Zod schema for SAP AI language model provider options.
 *
 * These options can be passed per-call via `providerOptions['sap-ai']` to override
 * constructor settings or provide request-specific configuration.
 * @example
 * ```typescript
 * const result = await generateText({
 *   model: provider('gpt-4o'),
 *   prompt: 'Hello',
 *   providerOptions: {
 *     'sap-ai': {
 *       includeReasoning: true,
 *       modelParams: { temperature: 0.7, maxTokens: 1000 }
 *     }
 *   }
 * });
 * ```
 */
declare const sapAILanguageModelProviderOptions: _ai_sdk_provider_utils.LazySchema<{
    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;
}>;
/**
 * TypeScript type for SAP AI language model provider options.
 * Inferred from the Zod schema for type safety.
 */
type SAPAILanguageModelProviderOptions = InferSchema<typeof sapAILanguageModelProviderOptions>;
/**
 * Zod schema for SAP AI embedding model provider options.
 *
 * These options can be passed per-call via `providerOptions['sap-ai']` to override
 * constructor settings or provide request-specific configuration.
 * @example
 * ```typescript
 * const { embedding } = await embed({
 *   model: provider.embedding('text-embedding-ada-002'),
 *   value: 'Hello, world!',
 *   providerOptions: {
 *     'sap-ai': {
 *       type: 'query'
 *     }
 *   }
 * });
 * ```
 */
declare const sapAIEmbeddingProviderOptions: _ai_sdk_provider_utils.LazySchema<{
    modelParams?: {
        [x: string]: unknown;
        dimensions?: number | undefined;
        encoding_format?: "base64" | "binary" | "float" | undefined;
        normalize?: boolean | undefined;
    } | undefined;
    type?: "document" | "query" | "text" | undefined;
}>;
/**
 * TypeScript type for SAP AI embedding model provider options.
 * Inferred from the Zod schema for type safety.
 */
type SAPAIEmbeddingProviderOptions = InferSchema<typeof sapAIEmbeddingProviderOptions>;

/**
 * Supported model IDs in SAP AI Core.
 *
 * These models are available through the SAP AI Core Orchestration service.
 * **Note:** The models listed here are representative examples. Actual model availability
 * depends on your SAP AI Core tenant configuration, region, and subscription.
 * @see {@link https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/models-and-scenarios SAP AI Core Models Documentation}
 *
 * **Azure OpenAI Models:**
 * - gpt-4o, gpt-4o-mini
 * - gpt-4.1, gpt-4.1-mini, gpt-4.1-nano
 * - o1, o3, o3-mini, o4-mini
 *
 * **Google Vertex AI Models:**
 * - gemini-2.0-flash, gemini-2.0-flash-lite
 * - gemini-2.5-flash, gemini-2.5-pro
 * - ⚠️ **Limitation:** Gemini models support only 1 tool per request
 *
 * **AWS Bedrock Models:**
 * - anthropic--claude-3-haiku, anthropic--claude-3-sonnet, anthropic--claude-3-opus
 * - anthropic--claude-3.5-sonnet, anthropic--claude-3.7-sonnet
 * - anthropic--claude-4-sonnet, anthropic--claude-4-opus
 * - amazon--nova-pro, amazon--nova-lite, amazon--nova-micro, amazon--nova-premier
 *
 * **AI Core Open Source Models:**
 * - mistralai--mistral-large-instruct, mistralai--mistral-medium-instruct, mistralai--mistral-small-instruct
 * - meta--llama3.1-70b-instruct
 * - cohere--command-a-reasoning
 */
type SAPAIModelId = ChatModel;
/**
 * Settings for configuring SAP AI Core model behavior.
 *
 * These settings control model parameters, data masking, content filtering,
 * and tool usage. Settings can be provided at provider-level (defaults) or
 * per-model call (overrides).
 * @example
 * **Basic usage with model parameters**
 * ```typescript
 * const model = provider('gpt-4o', {
 *   modelParams: {
 *     temperature: 0.7,
 *     maxTokens: 2000
 *   }
 * });
 * ```
 * @example
 * **With data masking (DPI)**
 * ```typescript
 * import { buildDpiMaskingProvider } from '@mymediset/sap-ai-provider';
 *
 * const model = provider('gpt-4o', {
 *   masking: {
 *     masking_providers: [
 *       buildDpiMaskingProvider({
 *         method: 'anonymization',
 *         entities: ['profile-email', 'profile-person']
 *       })
 *     ]
 *   }
 * });
 * ```
 * @example
 * **With content filtering**
 * ```typescript
 * import { buildAzureContentSafetyFilter } from '@mymediset/sap-ai-provider';
 *
 * const model = provider('gpt-4o', {
 *   filtering: {
 *     input: {
 *       filters: [buildAzureContentSafetyFilter('input', { hate: 'ALLOW_SAFE' })]
 *     }
 *   }
 * });
 * ```
 */
interface SAPAISettings {
    /**
     * Filtering configuration for input and output content safety.
     * Supports Azure Content Safety and Llama Guard filters.
     * @see {@link https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/content-filtering SAP Content Filtering Documentation}
     * @example
     * ```typescript
     * import { buildAzureContentSafetyFilter } from '@sap-ai-sdk/orchestration';
     *
     * const model = provider('gpt-4o', {
     *   filtering: {
     *     input: {
     *       filters: [
     *         buildAzureContentSafetyFilter('input', {
     *           hate: 'ALLOW_SAFE',
     *           violence: 'ALLOW_SAFE_LOW_MEDIUM'
     *         })
     *       ]
     *     }
     *   }
     * });
     * ```
     */
    readonly filtering?: FilteringModule;
    /**
     * Grounding module configuration for document-based retrieval (RAG).
     * Enables retrieval-augmented generation using SAP Document Grounding Service.
     *
     * Use `buildDocumentGroundingConfig()` to create the configuration.
     * @see {@link https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/document-grounding SAP Document Grounding Documentation}
     * @example
     * ```typescript
     * import { buildDocumentGroundingConfig } from '@mymediset/sap-ai-provider';
     *
     * const model = provider('gpt-4o', {
     *   grounding: buildDocumentGroundingConfig({
     *     filters: [
     *       {
     *         id: 'my-vector-store',
     *         data_repository_type: 'vector',
     *         data_repositories: ['document-repo-1'],
     *         chunk_overlap: 50
     *       }
     *     ],
     *     placeholders: {
     *       input: ['?question'],
     *       output: 'groundingOutput'
     *     }
     *   })
     * });
     * ```
     */
    readonly grounding?: GroundingModule;
    /**
     * Whether to include assistant reasoning parts in the SAP prompt conversion.
     *
     * Reasoning parts contain internal model chain-of-thought reasoning. When disabled,
     * only the final response content is forwarded. Enable for debugging/analysis;
     * disable for production applications and user-facing chatbots.
     * @default false
     * @example
     * ```typescript
     * const debugModel = provider('gpt-4o', { includeReasoning: true });
     * const prodModel = provider('gpt-4o'); // includeReasoning defaults to false
     * ```
     */
    readonly includeReasoning?: boolean;
    /**
     * Masking configuration for SAP AI Core orchestration.
     * When provided, sensitive information in prompts can be anonymized or
     * pseudonymized by SAP Data Privacy Integration (DPI).
     * @see {@link https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/data-privacy-integration SAP DPI Documentation}
     * @example
     * ```typescript
     * import { buildDpiMaskingProvider } from '@sap-ai-sdk/orchestration';
     *
     * const model = provider('gpt-4o', {
     *   masking: {
     *     masking_providers: [
     *       buildDpiMaskingProvider({
     *         method: 'anonymization',
     *         entities: ['profile-email', 'profile-phone']
     *       })
     *     ]
     *   }
     * });
     * ```
     */
    readonly masking?: MaskingModule;
    /**
     * Model generation parameters that control the output.
     */
    readonly modelParams?: {
        /**
         * Frequency penalty between -2.0 and 2.0.
         * Positive values penalize tokens based on their frequency.
         * If not specified, the model's default is used (typically 0).
         */
        readonly frequencyPenalty?: number;
        /**
         * Maximum number of tokens to generate.
         * Higher values allow for longer responses but increase latency and cost.
         */
        readonly maxTokens?: number;
        /**
         * Number of completions to generate.
         * Multiple completions provide alternative responses.
         *
         * Note: Not supported by Amazon and Anthropic models. When used with these
         * models, the parameter is silently omitted from the request.
         * If not specified, typically defaults to 1 on the model side.
         */
        readonly n?: number;
        /**
         * Whether to enable parallel tool calls.
         * When enabled, the model can call multiple tools in parallel.
         *
         * Note: This uses the SAP/OpenAI-style key `parallel_tool_calls`.
         */
        readonly parallel_tool_calls?: boolean;
        /**
         * Presence penalty between -2.0 and 2.0.
         * Positive values penalize tokens that have appeared in the text.
         * If not specified, the model's default is used (typically 0).
         */
        readonly presencePenalty?: number;
        /**
         * Sampling temperature between 0 and 2.
         * Higher values make output more random, lower values more deterministic.
         * If not specified, the model's default temperature is used.
         */
        readonly temperature?: number;
        /**
         * Nucleus sampling parameter between 0 and 1.
         * Controls diversity via cumulative probability cutoff.
         * If not specified, the model's default topP is used (typically 1).
         */
        readonly topP?: number;
    };
    /**
     * Specific version of the model to use.
     * If not provided, the latest version will be used.
     */
    readonly modelVersion?: string;
    /**
     * Response format for templating prompt (OpenAI-compatible)
     * Allows specifying structured output formats
     * @example
     * ```typescript
     * const model = provider('gpt-4o', {
     *   responseFormat: {
     *     type: 'json_schema',
     *     json_schema: {
     *       name: 'response',
     *       schema: { type: 'object', properties: { answer: { type: 'string' } } }
     *     }
     *   }
     * });
     * ```
     */
    readonly responseFormat?: {
        readonly json_schema: {
            readonly description?: string;
            readonly name: string;
            readonly schema?: unknown;
            readonly strict?: boolean | null;
        };
        readonly type: "json_schema";
    } | {
        readonly type: "json_object";
    } | {
        readonly type: "text";
    };
    /**
     * Tool definitions in SAP AI SDK format
     *
     *
     * Use this to pass tools directly with proper JSON Schema definitions.
     * This bypasses the AI SDK's Zod conversion which may have issues.
     *
     * Note: This should be used in conjunction with AI SDK's tool handling
     * to provide the actual tool implementations (execute functions).
     * @example
     * ```typescript
     * const model = provider('gpt-4o', {
     *   tools: [
     *     {
     *       type: 'function',
     *       function: {
     *         name: 'get_weather',
     *         description: 'Get weather for a location',
     *         parameters: {
     *           type: 'object',
     *           properties: {
     *             location: { type: 'string', description: 'City name' }
     *           },
     *           required: ['location']
     *         }
     *       }
     *     }
     *   ]
     * });
     * ```
     */
    readonly tools?: ChatCompletionTool[];
    /**
     * Translation module configuration for input/output translation.
     * Enables automatic translation using SAP Document Translation service.
     *
     * Use `buildTranslationConfig()` to create input/output configurations.
     * @see {@link https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/translation SAP Translation Documentation}
     * @example
     * ```typescript
     * import { buildTranslationConfig } from '@mymediset/sap-ai-provider';
     *
     * const model = provider('gpt-4o', {
     *   translation: {
     *     input: buildTranslationConfig('input', {
     *       sourceLanguage: 'de-DE',
     *       targetLanguage: 'en-US'
     *     }),
     *     output: buildTranslationConfig('output', {
     *       targetLanguage: 'de-DE'
     *     })
     *   }
     * });
     * ```
     */
    readonly translation?: TranslationModule;
}

/**
 * SAP AI Language Model implementation.
 *
 * This module provides a LanguageModelV3 implementation that bridges
 * the Vercel AI SDK with SAP AI Core's Orchestration API using the
 * official SAP AI SDK (@sap-ai-sdk/orchestration).
 * @module sap-ai-language-model
 */

/**
 * Internal configuration for the SAP AI Chat Language Model.
 * @internal
 */
interface SAPAIConfig {
    readonly deploymentConfig: DeploymentIdConfig | ResourceGroupConfig;
    readonly destination?: HttpDestinationOrFetchOptions;
    readonly provider: string;
}
/**
 * SAP AI Chat Language Model implementation.
 *
 * This class implements the AI SDK's `LanguageModelV3` interface,
 * providing a bridge between the AI SDK and SAP AI Core's Orchestration API
 * using the official SAP AI SDK (@sap-ai-sdk/orchestration).
 *
 * **Features:**
 * - Text generation (streaming and non-streaming)
 * - Tool calling (function calling)
 * - Multi-modal input (text + images)
 * - Data masking (SAP DPI)
 * - Content filtering
 *
 * **Model Support:**
 * - Azure OpenAI models (gpt-4o, gpt-4o-mini, o1, o3, etc.)
 * - Google Vertex AI models (gemini-2.0-flash, gemini-2.5-pro, etc.)
 * - AWS Bedrock models (anthropic--claude-*, amazon--nova-*, etc.)
 * - AI Core open source models (mistralai--, cohere--, etc.)
 * @see {@link https://sdk.vercel.ai/docs/ai-sdk-core/language-model-v3 Vercel AI SDK LanguageModelV3}
 * @see {@link https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/orchestration SAP AI Core Orchestration}
 * @example
 * ```typescript
 * // Create via provider
 * const provider = createSAPAIProvider();
 * const model = provider('gpt-4o');
 *
 * // Use with AI SDK
 * const result = await generateText({
 *   model,
 *   prompt: 'Hello, world!'
 * });
 * ```
 */
declare class SAPAILanguageModel implements LanguageModelV3 {
    readonly modelId: SAPAIModelId;
    readonly specificationVersion = "v3";
    /**
     * Model capabilities.
     *
     * These defaults assume “modern” model behavior to avoid maintaining a
     * per-model capability matrix. If a deployment doesn't support a feature,
     * SAP AI Core will fail the request at runtime.
     */
    readonly supportsImageUrls: boolean;
    /**
     * Multiple completions via the `n` parameter.
     * Note: Amazon and Anthropic models do not support this feature.
     * The provider silently omits the parameter for unsupported models.
     */
    readonly supportsMultipleCompletions: boolean;
    /** Parallel tool calls. */
    readonly supportsParallelToolCalls: boolean;
    /** Streaming responses. */
    readonly supportsStreaming: boolean;
    /** Structured JSON outputs (json_schema response format). */
    readonly supportsStructuredOutputs: boolean;
    /** Tool/function calling. */
    readonly supportsToolCalls: boolean;
    /**
     * Returns the provider identifier.
     * @returns The provider name
     */
    get provider(): string;
    /**
     * Returns supported URL patterns for different content types.
     * @returns Record of content types to regex patterns
     */
    get supportedUrls(): Record<string, RegExp[]>;
    private readonly config;
    private readonly settings;
    /**
     * Creates a new SAP AI Chat Language Model instance.
     * @internal
     * @param modelId - The model identifier
     * @param settings - Model-specific configuration settings
     * @param config - Internal configuration (deployment config, destination, etc.)
     * @throws {z.ZodError} If modelParams contains invalid values
     */
    constructor(modelId: SAPAIModelId, settings: SAPAISettings, config: SAPAIConfig);
    /**
     * Generates a single completion (non-streaming).
     *
     * This method implements the `LanguageModelV3.doGenerate` interface,
     * sending a request to SAP AI Core and returning the complete response.
     *
     * **Features:**
     * - Tool calling support
     * - Multi-modal input (text + images)
     * - Data masking (if configured)
     * - Content filtering (if configured)
     * - Abort signal support (via Promise.race)
     *
     * **Note on Abort Signal:**
     * The abort signal implementation uses Promise.race to reject the promise when
     * aborted. However, this does not cancel the underlying HTTP request to SAP AI Core -
     * the request continues executing on the server. This is a current limitation of the
     * SAP AI SDK's API. See https://github.com/SAP/ai-sdk-js/issues/1429
     * @param options - Generation options including prompt, tools, and settings
     * @returns Promise resolving to the generation result with content, usage, and metadata
     * @since 1.0.0
     * @example
     * ```typescript
     * const result = await model.doGenerate({
     *   prompt: [
     *     { role: 'user', content: [{ type: 'text', text: 'Hello!' }] }
     *   ]
     * });
     *
     * console.log(result.content); // Generated content
     * console.log(result.usage);   // Token usage
     * ```
     */
    doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
    /**
     * Generates a streaming completion.
     *
     * Implements `LanguageModelV3.doStream`, sending a streaming request to SAP AI Core
     * and returning a stream of response parts.
     *
     * **Stream Events:**
     * - `stream-start` - Initialization with warnings
     * - `response-metadata` - Model, timestamp, response ID
     * - `text-start` - Text block begins (with unique ID)
     * - `text-delta` - Incremental text chunks
     * - `text-end` - Text block completes
     * - `tool-input-start/delta/end` - Tool input lifecycle
     * - `tool-call` - Complete tool call
     * - `finish` - Stream completes with usage and finish reason
     * - `error` - Error occurred
     *
     * **Response ID:**
     * Client-generated UUID in `response-metadata.id` and `providerMetadata['sap-ai'].responseId`.
     * TODO: Use backend's `x-request-id` when `OrchestrationStreamResponse` exposes `rawResponse`.
     *
     * **Abort Signal:**
     * Same limitation as `doGenerate` - see its documentation for details.
     * @see {@link https://sdk.vercel.ai/docs/ai-sdk-core/streaming Vercel AI SDK Streaming}
     * @param options - Streaming options including prompt, tools, and settings
     * @returns Promise resolving to stream and request metadata
     * @example
     * ```typescript
     * const { stream } = await model.doStream({
     *   prompt: [
     *     { role: 'user', content: [{ type: 'text', text: 'Write a story' }] }
     *   ]
     * });
     *
     * for await (const part of stream) {
     *   if (part.type === 'text-delta') {
     *     process.stdout.write(part.delta);
     *   }
     * }
     * ```
     * @since 1.0.0
     */
    doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
    /**
     * Checks if a URL is supported for file/image uploads.
     * @param url - The URL to check
     * @returns True if the URL protocol is HTTPS or data with valid image format
     */
    supportsUrl(url: URL): boolean;
    /**
     * Builds orchestration module config for SAP AI SDK.
     * @param options - Call options from the AI SDK
     * @returns Promise resolving to object containing orchestration config, messages, and warnings
     * @internal
     */
    private buildOrchestrationConfig;
    /**
     * Creates an OrchestrationClient instance.
     * @param config - Orchestration module configuration
     * @returns OrchestrationClient instance
     * @internal
     */
    private createClient;
}

/**
 * Deployment configuration type used by SAP AI SDK.
 */
type DeploymentConfig = DeploymentIdConfig | ResourceGroupConfig;
/**
 * SAP AI Provider interface.
 *
 * This is the main interface for creating and configuring SAP AI Core models.
 * It extends the standard AI SDK ProviderV3 interface with SAP-specific functionality.
 * @example
 * ```typescript
 * const provider = createSAPAIProvider({
 *   resourceGroup: 'default'
 * });
 *
 * // Create a model instance
 * const model = provider('gpt-4o', {
 *   modelParams: {
 *     temperature: 0.7,
 *     maxTokens: 1000
 *   }
 * });
 *
 * // Or use the explicit chat method
 * const chatModel = provider.chat('gpt-4o');
 * ```
 */
interface SAPAIProvider extends ProviderV3 {
    /**
     * Create a language model instance.
     * @param modelId - The SAP AI Core model identifier (e.g., 'gpt-4o', 'anthropic--claude-3.5-sonnet')
     * @param settings - Optional model configuration settings
     * @returns Configured SAP AI chat language model instance
     */
    (modelId: SAPAIModelId, settings?: SAPAISettings): SAPAILanguageModel;
    /**
     * Explicit method for creating chat models.
     *
     * This method is equivalent to calling the provider function directly,
     * but provides a more explicit API for chat-based interactions.
     * @param modelId - The SAP AI Core model identifier
     * @param settings - Optional model configuration settings
     * @returns Configured SAP AI chat language model instance
     */
    chat(modelId: SAPAIModelId, settings?: SAPAISettings): SAPAILanguageModel;
    /**
     * Create an embedding model instance.
     * @param modelId - The embedding model identifier (e.g., 'text-embedding-ada-002', 'text-embedding-3-small')
     * @param settings - Optional embedding model settings
     * @returns Configured SAP AI embedding model instance
     * @example
     * ```typescript
     * import { embed } from 'ai';
     *
     * const { embedding } = await embed({
     *   model: provider.embedding('text-embedding-ada-002'),
     *   value: 'Hello, world!'
     * });
     * ```
     */
    embedding(modelId: SAPAIEmbeddingModelId, settings?: SAPAIEmbeddingSettings): SAPAIEmbeddingModel;
    /**
     * Create an embedding model instance.
     *
     * Standard ProviderV3 method for creating embedding models.
     * Equivalent to calling `embedding()`.
     * @param modelId - The embedding model identifier
     * @param settings - Optional embedding model settings
     * @returns Configured SAP AI embedding model instance
     */
    embeddingModel(modelId: SAPAIEmbeddingModelId, settings?: SAPAIEmbeddingSettings): SAPAIEmbeddingModel;
    /**
     * Image model stub for ProviderV3 interface compliance.
     *
     * SAP AI Core Orchestration Service does not currently support image generation.
     * This method always throws a `NoSuchModelError` to indicate that image generation
     * is not available through this provider.
     * @param modelId - The image model identifier (not used)
     * @throws {NoSuchModelError} Always throws - image generation is not supported
     * @example
     * ```typescript
     * // This will always throw NoSuchModelError
     * provider.imageModel('dall-e-3'); // throws NoSuchModelError
     * ```
     */
    imageModel(modelId: string): never;
    /**
     * Create a language model instance.
     *
     * Standard ProviderV3 method for creating language models.
     * Equivalent to calling the provider function directly or using `chat()`.
     * @param modelId - The SAP AI Core model identifier
     * @param settings - Optional model configuration settings
     * @returns Configured SAP AI language model instance
     */
    languageModel(modelId: SAPAIModelId, settings?: SAPAISettings): SAPAILanguageModel;
    /**
     * Create a text embedding model instance.
     *
     * Alias for `embedding()` method, provided for compatibility with AI SDK conventions.
     * @param modelId - The embedding model identifier
     * @param settings - Optional embedding model settings
     * @returns Configured SAP AI embedding model instance
     * @deprecated Use `embeddingModel()` instead.
     */
    textEmbeddingModel(modelId: SAPAIEmbeddingModelId, settings?: SAPAIEmbeddingSettings): SAPAIEmbeddingModel;
}
/**
 * Configuration settings for the SAP AI Provider.
 *
 * This interface defines all available options for configuring the SAP AI Core connection
 * using the official SAP AI SDK. See {@link createSAPAIProvider} for authentication details.
 * @example
 * ```typescript
 * // Using default configuration (auto-detects service binding or env var)
 * const provider = createSAPAIProvider();
 *
 * // With specific resource group
 * const provider = createSAPAIProvider({
 *   resourceGroup: 'production'
 * });
 *
 * // With custom destination
 * const provider = createSAPAIProvider({
 *   destination: {
 *     url: 'https://my-ai-core-instance.cfapps.eu10.hana.ondemand.com'
 *   }
 * });
 * ```
 */
interface SAPAIProviderSettings {
    /**
     * Default model settings applied to every model instance created by this provider.
     * Per-call settings provided to the model will override these.
     */
    readonly defaultSettings?: SAPAISettings;
    /**
     * SAP AI Core deployment ID.
     *
     * A specific deployment ID to use for orchestration requests.
     * If not provided, the SDK will resolve the deployment automatically.
     * @example
     * ```typescript
     * deploymentId: 'd65d81e7c077e583'
     * ```
     */
    readonly deploymentId?: string;
    /**
     * Custom destination configuration for SAP AI Core.
     *
     * Override the default destination detection. Useful for:
     * - Custom proxy configurations
     * - Non-standard SAP AI Core setups
     * - Testing environments
     * @example
     * ```typescript
     * destination: {
     *   url: 'https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com'
     * }
     * ```
     */
    readonly destination?: HttpDestinationOrFetchOptions;
    /**
     * SAP AI Core resource group.
     *
     * Logical grouping of AI resources in SAP AI Core.
     * Used for resource isolation and access control.
     * Different resource groups can have different permissions and quotas.
     * @default 'default'
     * @example
     * ```typescript
     * resourceGroup: 'default'     // Default resource group
     * resourceGroup: 'production'  // Production environment
     * resourceGroup: 'development' // Development environment
     * ```
     */
    readonly resourceGroup?: string;
    /**
     * Whether to emit warnings for ambiguous configurations.
     *
     * When enabled (default), the provider will warn when mutually-exclusive
     * settings are provided (e.g. both `deploymentId` and `resourceGroup`).
     */
    readonly warnOnAmbiguousConfig?: boolean;
}
/**
 * Creates a SAP AI Core provider instance for use with the AI SDK.
 *
 * This is the main entry point for integrating SAP AI Core with the AI SDK.
 * It uses the official SAP AI SDK (@sap-ai-sdk/orchestration) under the hood,
 * which handles authentication and API communication automatically.
 *
 * **Authentication:**
 * The SAP AI SDK automatically handles authentication:
 * 1. On SAP BTP: Uses service binding (VCAP_SERVICES)
 * 2. Locally: Uses AICORE_SERVICE_KEY environment variable
 *
 * **Key Features:**
 * - Automatic authentication via SAP AI SDK
 * - Support for all SAP AI Core orchestration models
 * - Streaming and non-streaming responses
 * - Tool calling support
 * - Data masking (DPI)
 * - Content filtering
 * @param options - Configuration options for the provider
 * @returns A configured SAP AI provider
 * @example
 * **Basic Usage**
 * ```typescript
 * import { createSAPAIProvider } from '@mymediset/sap-ai-provider';
 * import { generateText } from 'ai';
 *
 * const provider = createSAPAIProvider();
 *
 * const result = await generateText({
 *   model: provider('gpt-4o'),
 *   prompt: 'Hello, world!'
 * });
 * ```
 * @example
 * **With Resource Group**
 * ```typescript
 * const provider = createSAPAIProvider({
 *   resourceGroup: 'production'
 * });
 *
 * const model = provider('anthropic--claude-3.5-sonnet', {
 *   modelParams: {
 *     temperature: 0.3,
 *     maxTokens: 2000
 *   }
 * });
 * ```
 * @example
 * **With Default Settings**
 * ```typescript
 * const provider = createSAPAIProvider({
 *   defaultSettings: {
 *     modelParams: {
 *       temperature: 0.7
 *     }
 *   }
 * });
 * ```
 */
declare function createSAPAIProvider(options?: SAPAIProviderSettings): SAPAIProvider;
/**
 * Default SAP AI provider instance.
 *
 * Uses default configuration with automatic authentication.
 * See {@link createSAPAIProvider} for authentication details.
 * @example
 * ```typescript
 * import { sapai } from '@mymediset/sap-ai-provider';
 * import { generateText } from 'ai';
 *
 * const result = await generateText({
 *   model: sapai('gpt-4o'),
 *   prompt: 'Hello!'
 * });
 * ```
 */
declare const sapai: SAPAIProvider;

export { type DeploymentConfig, SAPAIEmbeddingModel, type SAPAIEmbeddingModelId, type SAPAIEmbeddingProviderOptions, type SAPAIEmbeddingSettings, type SAPAILanguageModelProviderOptions, type SAPAIModelId, type SAPAIProvider, type SAPAIProviderSettings, type SAPAISettings, SAP_AI_PROVIDER_NAME, createSAPAIProvider, sapAIEmbeddingProviderOptions, sapAILanguageModelProviderOptions, sapai };
