genkitx-mistral
Version:
Firebase Genkit AI framework plugin for Mistral AI APIs.
245 lines (242 loc) • 9.38 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?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}, {
documentUrl: string;
type?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}>;
}>, "passthrough", z.ZodTypeAny, z.objectOutputType<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?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}, {
documentUrl: string;
type?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}>;
}>, z.ZodTypeAny, "passthrough">, z.objectInputType<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?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}, {
documentUrl: string;
type?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}>;
}>, z.ZodTypeAny, "passthrough">>;
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?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}, {
documentUrl: string;
type?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}>;
}>, "passthrough", z.ZodTypeAny, z.objectOutputType<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?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}, {
documentUrl: string;
type?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}>;
}>, z.ZodTypeAny, "passthrough">, z.objectInputType<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?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}, {
documentUrl: string;
type?: "document_url" | "image_url" | undefined;
documentName?: string | null | undefined;
imageUrl?: string | {
url: string;
detail?: string | null | undefined;
} | undefined;
}>;
}>, z.ZodTypeAny, "passthrough">>>;
declare function OCRModel(ai: Genkit, client: Mistral): ModelAction<typeof OCRSchema>;
export { OCRModel, ocr };