UNPKG

@langchain/core

Version:
1 lines 2.33 kB
{"version":3,"file":"document.d.cts","names":["DocumentInput","Record","Metadata","DocumentInterface","Document"],"sources":["../../src/documents/document.d.ts"],"sourcesContent":["export interface DocumentInput<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nMetadata extends Record<string, any> = Record<string, any>> {\n pageContent: string;\n metadata?: Metadata;\n /**\n * An optional identifier for the document.\n *\n * Ideally this should be unique across the document collection and formatted\n * as a UUID, but this will not be enforced.\n */\n id?: string;\n}\nexport interface DocumentInterface<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nMetadata extends Record<string, any> = Record<string, any>> {\n pageContent: string;\n metadata: Metadata;\n /**\n * An optional identifier for the document.\n *\n * Ideally this should be unique across the document collection and formatted\n * as a UUID, but this will not be enforced.\n */\n id?: string;\n}\n/**\n * Interface for interacting with a document.\n */\nexport declare class Document<\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nMetadata extends Record<string, any> = Record<string, any>> implements DocumentInput, DocumentInterface {\n pageContent: string;\n metadata: Metadata;\n // The ID field is optional at the moment.\n // It will likely become required in a future major release after\n // it has been adopted by enough vectorstore implementations.\n /**\n * An optional identifier for the document.\n *\n * Ideally this should be unique across the document collection and formatted\n * as a UUID, but this will not be enforced.\n */\n id?: string;\n constructor(fields: DocumentInput<Metadata>);\n}\n"],"mappings":";UAAiBA;AAAjB;iBAEiBC,MAFa,CAAA,MAAA,EAAA,GAAA,CAAA,GAESA,MAFT,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA;EAAA,WAEbA,EAAAA,MAAAA;EAAM,QAAgBA,CAAAA,EAExBC,QAFwBD;EAAM;AAEtB;AASvB;;;;EAE6C,EAAA,CAE/BC,EAAAA,MAAAA;AAAQ;AAYDE,UAhBJD,iBAgBY;;iBAdZF,MAgBAA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAhBsBA,MAgBtBA,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,CAAAA,CAAAA;EAAM,WAAgBA,EAAAA,MAAAA;EAAM,QAE/BC,EAhBAA,QAgBAA;EAAQ;;;;AAFiF;;;;;;;cAFlFE;;iBAEJH,sBAAsBA,gCAAgCD,eAAeG;;YAExED;;;;;;;;;;;sBAWUF,cAAcE"}