@langchain/core
Version:
Core LangChain.js abstractions and schemas
107 lines (106 loc) • 2.95 kB
text/typescript
import { BaseContentBlock } from "./base.cjs";
//#region src/messages/content/multimodal.d.ts
type Multimodal = never;
declare namespace Multimodal {
type BaseDataRecord = {
/**
* MIME type of the file.
*
* @see https://www.iana.org/assignments/media-types/media-types.xhtml#image
*/
mimeType?: string | undefined;
};
type DataRecordFileId = BaseDataRecord & {
/**
* ID of the data file, e.g. from a provider's file api
*/
fileId: string;
url?: never;
data?: never;
};
type DataRecordUrl = BaseDataRecord & {
fileId?: never;
/**
* URL of the data file
*/
url: string;
data?: never;
};
type DataRecordBase64 = BaseDataRecord & {
fileId?: never;
url?: never;
/**
* MIME type of the file. Required for base64 encoding.
*
* @see https://www.iana.org/assignments/media-types/media-types.xhtml#image
*/
mimeType: string;
/**
* Base64 encoded string or binary data of the data
*/
data: string | Uint8Array;
};
type DataRecord = DataRecordFileId | DataRecordUrl | DataRecordBase64;
/** Content block for multimodal data */
type Data<TMetadata = Record<string, unknown>> = BaseContentBlock & DataRecord & {
/**
* MIME type of the file. Required for base64 encoding.
*/
mimeType?: string;
/**
* Metadata of the file
*/
metadata?: TMetadata;
/**
* Content block identifier for multimodal content, e.g. image, video, audio, file or plain text. This can be either:
* - generated by the provider (e.g., an OpenAI block ID)
* - generated by LangChain upon creation
*/
id?: string;
};
/** Content block for image data */
type Image = Data & {
/** Type of the content block */
readonly type: "image";
};
/** Content block for video data */
type Video = Data & {
/** Type of the content block */
readonly type: "video";
};
/** Content block for audio data */
type Audio = Data & {
/** Type of the content block */
readonly type: "audio";
};
/** Content block for plain text data */
type PlainText = Data & {
/** Type of the content block */
readonly type: "text-plain";
/**
* Plaintext content. This is optional if the data is base64 encoded.
*/
text?: string;
/**
* Title of the file, e.g. the title of a document
*/
title?: string;
/**
* Context for the text, e.g. a description or a summary of the text's content
*/
context?: string;
};
/** Content block for file data */
type File = Data & {
/**
* Non-descript multimodal content block
*
* This block is intended for files that aren't covered by existing content block types.
*/
readonly type: "file";
};
type Standard = Image | Video | Audio | PlainText | File;
}
//#endregion
export { Multimodal };
//# sourceMappingURL=multimodal.d.cts.map