genkitx-mistral
Version:
Firebase Genkit AI framework plugin for Mistral AI APIs.
153 lines (150 loc) • 5.37 kB
text/typescript
import * as genkit from 'genkit';
import { z, Genkit } from 'genkit';
import { Mistral } from '@mistralai/mistralai';
import { ModelAction } from 'genkit/model';
declare const OCRSchema: z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
document: z.ZodObject<{
type: z.ZodOptional<z.ZodEnum<["document_url", "image_url"]>>;
documentUrl: z.ZodString;
documentName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
imageUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
url: z.ZodString;
detail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
url: string;
detail?: string | null | undefined;
}, {
url: string;
detail?: string | null | undefined;
}>]>>;
}, "strip", z.ZodTypeAny, {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
}, {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
}>;
}>, "strip", z.ZodTypeAny, {
document: {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
};
version?: string | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
document: {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
};
version?: string | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>;
declare const ocr: genkit.ModelReference<z.ZodObject<z.objectUtil.extendShape<{
version: z.ZodOptional<z.ZodString>;
temperature: z.ZodOptional<z.ZodNumber>;
maxOutputTokens: z.ZodOptional<z.ZodNumber>;
topK: z.ZodOptional<z.ZodNumber>;
topP: z.ZodOptional<z.ZodNumber>;
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {
document: z.ZodObject<{
type: z.ZodOptional<z.ZodEnum<["document_url", "image_url"]>>;
documentUrl: z.ZodString;
documentName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
imageUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
url: z.ZodString;
detail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
}, "strip", z.ZodTypeAny, {
url: string;
detail?: string | null | undefined;
}, {
url: string;
detail?: string | null | undefined;
}>]>>;
}, "strip", z.ZodTypeAny, {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
}, {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
}>;
}>, "strip", z.ZodTypeAny, {
document: {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
};
version?: string | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}, {
document: {
documentUrl: string;
type?: "image_url" | "document_url" | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
documentName?: string | null | undefined;
};
version?: string | undefined;
temperature?: number | undefined;
maxOutputTokens?: number | undefined;
topK?: number | undefined;
topP?: number | undefined;
stopSequences?: string[] | undefined;
}>>;
declare function OCRModel(ai: Genkit, client: Mistral): ModelAction<typeof OCRSchema>;
export { OCRModel, ocr };