UNPKG

genkitx-mistral

Version:

Firebase Genkit AI framework plugin for Mistral AI APIs.

51 lines (48 loc) 1.84 kB
import * as genkit_plugin from 'genkit/plugin'; import { ModelReference, GenerationCommonConfigSchema } from 'genkit'; import { SDKOptions } from '@mistralai/mistralai'; export { openCodestral, openCodestralMambda, openMinistral3B, openMinistral8B, openMistral7B, openMistral8x7B, openMistralLarge, openMistralMedium, openMistralNemo, openMistralSaba, openMistralSmall, openMixtral8x22B, openPixtral, openPixtralLarge } from './mistral_llms.js'; export { ocr } from './ocr.js'; export { mistralembed } from './embedders.js'; import 'genkit/model'; import '@mistralai/mistralai/models/components/index.js'; interface PluginOptions extends SDKOptions { /** * Additional models references that the user wants to add to the plugin. * These models should be created with the `modelRef` function and then passed in here. * @example * ```ts * const customModel = modelRef({ * name: 'mistral/custom-model', * info: { * versions: ['custom-model'], * label: 'Custom Model', * supports: { * multiturn: true, * tools: false, * media: false, * systemRole: true, * output: ['text', 'json'], * }, * }, * configSchema: GenerationCommonConfigSchema, * }); * * const ai = genkit({ * plugins: [ * mistral({ * apiKey: process.env.MISTRAL_API_KEY, * serverURL: process.env.MISTRAL_ENDPOINT, * customModels: { * 'custom-model': customModel, * }, * }), * ], * }); * ``` * */ customModels?: Record<string, ModelReference<typeof GenerationCommonConfigSchema>>; } declare const mistral: (options?: PluginOptions) => genkit_plugin.GenkitPlugin; export { type PluginOptions, mistral as default, mistral };