import { LanguageModelV2, LanguageModelV2CallOptions, LanguageModelV2Content, LanguageModelV2FinishReason, LanguageModelV2Usage, LanguageModelV2CallWarning, LanguageModelV2ResponseMetadata, SharedV2Headers, LanguageModelV2StreamPart, ProviderV2, EmbeddingModelV2 } from '@ai-sdk/provider';
import { FetchFunction } from '@ai-sdk/provider-utils';
import { z } from 'zod/v4';

declare const WatsonxClusters: readonly ["ca-tor", "jp-tok", "eu-gb", "eu-de", "us-south", "au-syd"];
type WatsonxCluster = (typeof WatsonxClusters)[number];
declare const watsonxModerationsSchema: z.ZodOptional<z.ZodObject<{
    hap: z.ZodObject<{
        input: z.ZodObject<{
            enabled: z.ZodBoolean;
            threshold: z.ZodNumber;
        }, z.core.$strip>;
        output: z.ZodObject<{
            enabled: z.ZodBoolean;
            threshold: z.ZodNumber;
        }, z.core.$strip>;
        mask: z.ZodObject<{
            remove_entity_value: z.ZodBoolean;
        }, z.core.$strip>;
    }, z.core.$strip>;
    pii: z.ZodObject<{
        input: z.ZodObject<{
            enabled: z.ZodBoolean;
        }, z.core.$strip>;
        output: z.ZodObject<{
            enabled: z.ZodBoolean;
        }, z.core.$strip>;
        mask: z.ZodObject<{
            remove_entity_value: z.ZodBoolean;
        }, z.core.$strip>;
    }, z.core.$strip>;
}, z.core.$strip>>;

declare const ChatModelLists: {
    readonly 'ca-tor': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-3-70b-instruct"];
    readonly 'jp-tok': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "meta-llama/llama-guard-3-11b-vision", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503"];
    readonly 'eu-gb': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8"];
    readonly 'eu-de': readonly ["ibm/granite-3-3-8b-instruct", "ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503"];
    readonly 'us-south': readonly ["ibm/granite-3-2-8b-instruct", "ibm/granite-3-3-8b-instruct", "ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-3-405b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "meta-llama/llama-guard-3-11b-vision", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503", "openai/gpt-oss-120b"];
    readonly 'au-syd': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-guard-3-11b-vision"];
};
type WatsonxChatRegion = keyof typeof ChatModelLists;
type WatsonxChatModelId = (typeof ChatModelLists)[WatsonxChatRegion][number] | (string & {});
type WatsonxChatModelIdFor<C extends WatsonxCluster> = (typeof ChatModelLists)[C][number] | (string & {});
declare const VisionModelLists: {
    readonly 'ca-tor': readonly ["meta-llama/llama-3-2-11b-vision-instruct"];
    readonly 'jp-tok': readonly ["meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "meta-llama/llama-guard-3-11b-vision", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503"];
    readonly 'eu-gb': readonly ["meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8"];
    readonly 'eu-de': readonly ["meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503"];
    readonly 'us-south': readonly ["meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "meta-llama/llama-guard-3-11b-vision", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503"];
    readonly 'au-syd': readonly ["meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-guard-3-11b-vision"];
};
declare const FunctionCallingModelLists: {
    readonly 'ca-tor': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-3-70b-instruct"];
    readonly 'jp-tok': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503"];
    readonly 'eu-gb': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8"];
    readonly 'eu-de': readonly ["ibm/granite-3-3-8b-instruct", "ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503"];
    readonly 'us-south': readonly ["ibm/granite-3-2-8b-instruct", "ibm/granite-3-3-8b-instruct", "ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct", "meta-llama/llama-3-3-70b-instruct", "meta-llama/llama-3-405b-instruct", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8", "mistralai/mistral-medium-2505", "mistralai/mistral-small-3-1-24b-instruct-2503", "openai/gpt-oss-120b"];
    readonly 'au-syd': readonly ["ibm/granite-3-8b-instruct", "meta-llama/llama-3-2-11b-vision-instruct", "meta-llama/llama-3-2-90b-vision-instruct"];
};
type WatsonxChatConfig = {
    provider: string;
    clusterURL: string;
    projectID: string;
    headers: () => Record<string, string | undefined>;
    fetch?: FetchFunction;
    version: string;
};
interface WatsonxChatSetting {
    moderations?: z.infer<typeof watsonxModerationsSchema>;
}

declare class WatsonxChatModel implements LanguageModelV2 {
    readonly specificationVersion: "v2";
    readonly provider: string;
    readonly defaultObjectGenerationMode: "tool";
    readonly supportsImageUrls = false;
    readonly supportedUrls: Record<string, RegExp[]>;
    readonly modelId: WatsonxChatModelId;
    readonly settings: WatsonxChatSetting;
    private readonly config;
    constructor(modelId: WatsonxChatModelId, settings: WatsonxChatSetting, config: WatsonxChatConfig);
    private sanityCheck;
    private getArgs;
    doGenerate(options: LanguageModelV2CallOptions): Promise<{
        content: Array<LanguageModelV2Content>;
        finishReason: LanguageModelV2FinishReason;
        usage: LanguageModelV2Usage;
        warnings: Array<LanguageModelV2CallWarning>;
        request?: {
            body?: unknown;
        };
        response?: LanguageModelV2ResponseMetadata & {
            headers?: SharedV2Headers;
            body?: unknown;
        };
    }>;
    doStream(options: LanguageModelV2CallOptions): Promise<{
        stream: ReadableStream<LanguageModelV2StreamPart>;
        warnings: Array<LanguageModelV2CallWarning>;
        request?: {
            body?: unknown;
        };
        response?: LanguageModelV2ResponseMetadata & {
            headers?: SharedV2Headers;
            body?: unknown;
        };
    }>;
}

declare const EmbedingModelLists: {
    readonly 'ca-tor': readonly ["ibm/granite-embedding-278m-multilingual", "ibm/slate-125m-english-rtrvr-v2", "ibm/slate-30m-english-rtrvr-v2", "intfloat/multilingual-e5-large"];
    readonly 'jp-tok': readonly ["ibm/granite-embedding-278m-multilingual", "ibm/slate-125m-english-rtrvr-v2", "ibm/slate-30m-english-rtrvr-v2", "intfloat/multilingual-e5-large", "sentence-transformers/all-minilm-l6-v2"];
    readonly 'eu-gb': readonly ["ibm/granite-embedding-278m-multilingual", "ibm/slate-125m-english-rtrvr-v2", "ibm/slate-30m-english-rtrvr-v2", "intfloat/multilingual-e5-large", "sentence-transformers/all-minilm-l6-v2"];
    readonly 'eu-de': readonly ["ibm/granite-embedding-278m-multilingual", "ibm/slate-125m-english-rtrvr-v2", "ibm/slate-30m-english-rtrvr-v2", "intfloat/multilingual-e5-large", "sentence-transformers/all-minilm-l6-v2"];
    readonly 'us-south': readonly ["ibm/granite-embedding-278m-multilingual", "ibm/slate-125m-english-rtrvr-v2", "ibm/slate-30m-english-rtrvr-v2", "intfloat/multilingual-e5-large", "sentence-transformers/all-minilm-l6-v2"];
    readonly 'au-syd': readonly ["ibm/slate-125m-english-rtrvr-v2", "ibm/slate-30m-english-rtrvr-v2", "intfloat/multilingual-e5-large"];
};
type WatsonxEmbeddingRegion = keyof typeof EmbedingModelLists;
type WatsonxEmbeddingModelId = (typeof EmbedingModelLists)[WatsonxEmbeddingRegion][number] | (string & {});
type WatsonxEmbeddingModelIdFor<C extends WatsonxCluster> = (typeof EmbedingModelLists)[C][number] | (string & {});
interface WatsonxEmbeddingSetting {
    /**
       Represents the maximum number of tokens accepted per input.
       This can be used to avoid requests failing due to input being longer than configured limits. If the text is truncated, then it truncates the end of the input (on the right),
       so the start of the input will remain the same.
       If this value exceeds the maximum sequence length (refer to the documentation to find this value for the model)
       then the call will fail if the total number of tokens exceeds the maximum sequence length.
       */
    truncate_input_tokens?: number;
    /**
       Maximum number of embeddings that can be requested in a single call.
       */
    maxEmbeddingsPerCall?: number;
    /**
       Whether the model supports parallel embedding calls.
       */
    supportsParallelCalls?: boolean;
    /**
       Include the input text in each of the results documents.
       */
    return_options?: {
        input_text?: boolean;
    };
}

declare const CompletionModelLists: {
    readonly 'ca-tor': readonly [];
    readonly 'jp-tok': readonly [];
    readonly 'eu-gb': readonly [];
    readonly 'eu-de': readonly ["sdaia/allam-1-13b-instruct"];
    readonly 'us-south': readonly ["ibm/granite-8b-code-instruct"];
    readonly 'au-syd': readonly ["ibm/granite-8b-code-instruct"];
};
type WatsonxCompletionRegion = keyof typeof CompletionModelLists;
type WatsonxCompletionModelId = (typeof CompletionModelLists)[WatsonxCompletionRegion][number] | (string & {});
type WatsonxCompletionModelIdFor<C extends WatsonxCluster> = (typeof CompletionModelLists)[C][number] | (string & {});
type WatsonxCompletionConfig = {
    provider: string;
    clusterURL: string;
    projectID: string;
    headers: () => Record<string, string | undefined>;
    fetch?: FetchFunction;
    version: string;
};
interface WatsonxCompletionSetting {
    moderations?: z.infer<typeof watsonxModerationsSchema>;
    decodingMethod?: 'sample' | 'greedy';
    returnInputText?: boolean;
    maxNewTokens?: number;
    minNewTokens?: number;
    returnOptions?: {
        inputText?: boolean;
        generatedTokens?: boolean;
    };
    textgenLengthPenalty?: {
        decayFactor?: number;
        startIndex?: number;
    };
}

declare class WatsonxCompletionModel implements LanguageModelV2 {
    readonly specificationVersion: "v2";
    readonly provider: string;
    readonly defaultObjectGenerationMode: undefined;
    readonly supportsImageUrls = false;
    readonly supportedUrls: Record<string, RegExp[]>;
    readonly modelId: WatsonxCompletionModelId;
    readonly settings: WatsonxCompletionSetting;
    private readonly config;
    constructor(modelId: WatsonxCompletionModelId, settings: WatsonxCompletionSetting, config: WatsonxCompletionConfig);
    private getArgs;
    doGenerate(options: LanguageModelV2CallOptions): Promise<{
        content: Array<{
            type: 'text';
            text: string;
        }>;
        finishReason: LanguageModelV2FinishReason;
        usage: LanguageModelV2Usage;
        warnings: Array<LanguageModelV2CallWarning>;
        request?: {
            body?: unknown;
        };
        response?: LanguageModelV2ResponseMetadata & {
            headers?: SharedV2Headers;
            body?: unknown;
        };
    }>;
    doStream(options: LanguageModelV2CallOptions): Promise<{
        stream: ReadableStream<LanguageModelV2StreamPart>;
        warnings: Array<LanguageModelV2CallWarning>;
        request?: {
            body?: unknown;
        };
        response?: LanguageModelV2ResponseMetadata & {
            headers?: SharedV2Headers;
            body?: unknown;
        };
    }>;
}

interface WatsonxProvider<C extends WatsonxCluster = WatsonxCluster> extends ProviderV2 {
    (modelId: WatsonxChatModelIdFor<C>, settings?: WatsonxChatSetting): WatsonxChatModel;
    languageModel(modelId: WatsonxChatModelIdFor<C>, settings?: WatsonxChatSetting): WatsonxChatModel;
    embedding(modelId: WatsonxEmbeddingModelIdFor<C>, settings?: WatsonxEmbeddingSetting): EmbeddingModelV2<string>;
    completion(modelId: WatsonxCompletionModelIdFor<C>, settings?: WatsonxCompletionSetting): WatsonxCompletionModel;
    textEmbeddingModel(modelId: WatsonxEmbeddingModelIdFor<C>, settings?: WatsonxEmbeddingSetting): EmbeddingModelV2<string>;
    textEmbedding(modelId: WatsonxEmbeddingModelIdFor<C>, settings?: WatsonxEmbeddingSetting): EmbeddingModelV2<string>;
}
interface WatsonxProviderSetting<C extends WatsonxCluster = WatsonxCluster> {
    /**
       The cluster which you host your watsonx AI project
  
       This uses the default IBM watsonx API URL (which is: https://{cluster url}.ml.cloud.ibm.com).
  
       Of course, you can always override it in clusterURL
       */
    cluster?: C;
    /**
       The Project ID that hosts your watsonx model
  
       Find it in the GUI here: https://{cluster}.dataplatform.cloud.ibm.com/projects/?context=wx click on your project > manage
  
       Of course, you can always override it in clusterURL
       */
    projectID?: string;
    /**
       Custom cluster URL
       */
    clusterURL?: string;
    /**
       Bearer token that is being send using the `Authorization` header.
       It defaults to the `MISTRAL_API_KEY` environment variable.
  
       The easiest way to obtain this token:
  
       https://cloud.ibm.com/docs/account?topic=account-iamtoken_from_apikey#iamtoken_from_apikey
  
       or via this cURL command:
       `curl -X POST 'https://iam.cloud.ibm.com/identity/token' -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=urn:ibm:params:oauth:grant-type:apikey&apikey=MY_APIKEY'`
       */
    bearerToken?: string;
    /**
       Custom headers to include in the requests.
       */
    headers?: Record<string, string>;
    /**
       Custom fetch implementation. You can use it as a middleware to intercept requests,
       or to provide a custom fetch implementation for e.g. testing.
       */
    fetch?: FetchFunction;
}
declare function createWatsonx<C extends WatsonxCluster = WatsonxCluster>(options?: WatsonxProviderSetting<C>): WatsonxProvider<C>;
declare const watsonx: WatsonxProvider<"ca-tor" | "jp-tok" | "eu-gb" | "eu-de" | "us-south" | "au-syd">;

export { ChatModelLists, CompletionModelLists, EmbedingModelLists, FunctionCallingModelLists, VisionModelLists, type WatsonxChatModelId, type WatsonxChatModelIdFor, type WatsonxChatRegion, type WatsonxCluster, WatsonxClusters, type WatsonxCompletionModelId, type WatsonxCompletionModelIdFor, type WatsonxCompletionRegion, type WatsonxEmbeddingModelId, type WatsonxEmbeddingModelIdFor, type WatsonxEmbeddingRegion, type WatsonxProvider, type WatsonxProviderSetting, createWatsonx, watsonx };
