import { CompletionChunk, ChatCompletionChoiceFinishReason, ChatCompletionResponse, ChatCompletionRequest } from '@mistralai/mistralai-gcp/models/components'; import { ModelReference, z, Part, GenerateRequest, ModelResponseData, Genkit } from 'genkit'; import { ModelAction } from 'genkit/model'; /** * Copyright 2024 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 * @deprecated */ 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">>; /** * @deprecated */ declare const mistralLarge: 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">>>; /** * @deprecated */ declare const mistralNemo: 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">>>; /** * @deprecated */ declare const codestral: 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">>>; /** * @deprecated */ declare const SUPPORTED_MISTRAL_MODELS: Record>; /** * @deprecated */ declare function toMistralRequest(model: string, input: GenerateRequest): ChatCompletionRequest; /** * Maps Mistral finish reasons to Genkit finish reasons * @deprecated */ declare function fromMistralFinishReason(reason: ChatCompletionChoiceFinishReason | undefined): 'length' | 'unknown' | 'stop' | 'blocked' | 'other'; /** * Converts a Mistral response to a Genkit response * @deprecated */ declare function fromMistralResponse(_input: GenerateRequest, response: ChatCompletionResponse): ModelResponseData; /** @deprecated */ declare function mistralModel(ai: Genkit, modelName: string, projectId: string, region: string): ModelAction; /** @deprecated */ declare function fromMistralCompletionChunk(chunk: CompletionChunk): Part[]; export { MistralConfigSchema, SUPPORTED_MISTRAL_MODELS, codestral, fromMistralCompletionChunk, fromMistralFinishReason, fromMistralResponse, mistralLarge, mistralModel, mistralNemo, toMistralRequest };