import { CompletionChunk, ChatCompletionChoiceFinishReason, ChatCompletionResponse, ChatCompletionRequest } from '@mistralai/mistralai-gcp/models/components'; import { ModelReference, z, Part, GenerateRequest, ModelResponseData, ActionMetadata } from 'genkit'; import { ModelAction } from 'genkit/model'; import { PluginOptions } from './types.js'; import '../../types-B3i-Lt7D.js'; import 'google-auth-library'; import '@google-cloud/vertexai'; /** * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * See https://docs.mistral.ai/api/#tag/chat/operation/chat_completion_v1_chat_completions_post */ declare const MistralConfigSchema: z.ZodObject<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; type MistralConfigSchemaType = typeof MistralConfigSchema; type MistralConfig = z.infer; declare const GENERIC_MODEL: ModelReference; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>>; declare const KNOWN_MODELS: { 'mistral-medium-3': ModelReference; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>>; 'mistral-ocr-2505': ModelReference; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>>; 'mistral-small-2503': ModelReference; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>>; 'codestral-2': ModelReference; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ version: z.ZodOptional; temperature: z.ZodOptional; maxOutputTokens: z.ZodOptional; topK: z.ZodOptional; stopSequences: z.ZodOptional>; apiKey: z.ZodOptional; } & { location: z.ZodOptional; topP: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>>; }; type KnownModels = keyof typeof KNOWN_MODELS; type MistralModelName = `${string}tral-${string}`; declare function isMistralModelName(value?: string): value is MistralModelName; declare function model(version: string, options?: MistralConfig): ModelReference; declare function listActions(clientOptions: ClientOptions): ActionMetadata[]; interface ClientOptions { location: string; projectId: string; } declare function listKnownModels(clientOptions: ClientOptions, pluginOptions?: PluginOptions): ModelAction[]; declare function defineModel(name: string, clientOptions: ClientOptions, pluginOptions?: PluginOptions): ModelAction; declare function toMistralRequest(model: string, input: GenerateRequest): ChatCompletionRequest; declare function fromMistralFinishReason(reason: ChatCompletionChoiceFinishReason | undefined): 'length' | 'unknown' | 'stop' | 'blocked' | 'other'; declare function fromMistralResponse(_input: GenerateRequest, response: ChatCompletionResponse): ModelResponseData; declare function fromMistralCompletionChunk(chunk: CompletionChunk): Part[]; export { GENERIC_MODEL, KNOWN_MODELS, type KnownModels, type MistralConfig, MistralConfigSchema, type MistralConfigSchemaType, type MistralModelName, defineModel, fromMistralCompletionChunk, fromMistralFinishReason, fromMistralResponse, isMistralModelName, listActions, listKnownModels, model, toMistralRequest };