UNPKG

@langchain/core

Version:
1 lines 4 kB
{"version":3,"file":"serializable.d.cts","names":["SerializedFields","BaseSerialized","T","Record","SerializedConstructor","SerializedSecret","SerializedNotImplemented","Serialized","get_lc_unique_name","Serializable","SerializableInterface"],"sources":["../../src/load/serializable.d.ts"],"sourcesContent":["import { type SerializedFields } from \"./map_keys.js\";\nexport interface BaseSerialized<T extends string> {\n lc: number;\n type: T;\n id: string[];\n name?: string;\n graph?: Record<string, any>;\n}\nexport interface SerializedConstructor extends BaseSerialized<\"constructor\"> {\n kwargs: SerializedFields;\n}\nexport interface SerializedSecret extends BaseSerialized<\"secret\"> {\n}\nexport interface SerializedNotImplemented extends BaseSerialized<\"not_implemented\"> {\n}\nexport type Serialized = SerializedConstructor | SerializedSecret | SerializedNotImplemented;\n/**\n * Get a unique name for the module, rather than parent class implementations.\n * Should not be subclassed, subclass lc_name above instead.\n */\nexport declare function get_lc_unique_name(serializableClass: typeof Serializable): string;\nexport interface SerializableInterface {\n get lc_id(): string[];\n}\nexport declare abstract class Serializable implements SerializableInterface {\n lc_serializable: boolean;\n lc_kwargs: SerializedFields;\n /**\n * A path to the module that contains the class, eg. [\"langchain\", \"llms\"]\n * Usually should be the same as the entrypoint the class is exported from.\n */\n abstract lc_namespace: string[];\n /**\n * The name of the serializable. Override to provide an alias or\n * to preserve the serialized module name in minified environments.\n *\n * Implemented as a static method to support loading logic.\n */\n static lc_name(): string;\n /**\n * The final serialized identifier for the module.\n */\n get lc_id(): string[];\n /**\n * A map of secrets, which will be omitted from serialization.\n * Keys are paths to the secret in constructor args, e.g. \"foo.bar.baz\".\n * Values are the secret ids, which will be used when deserializing.\n */\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n /**\n * A map of additional attributes to merge with constructor args.\n * Keys are the attribute names, e.g. \"foo\".\n * Values are the attribute values, which will be serialized.\n * These attributes need to be accepted by the constructor as arguments.\n */\n get lc_attributes(): SerializedFields | undefined;\n /**\n * A map of aliases for constructor args.\n * Keys are the attribute names, e.g. \"foo\".\n * Values are the alias that will replace the key in serialization.\n * This is used to eg. make argument names match Python.\n */\n get lc_aliases(): {\n [key: string]: string;\n } | undefined;\n /**\n * A manual list of keys that should be serialized.\n * If not overridden, all fields passed into the constructor will be serialized.\n */\n get lc_serializable_keys(): string[] | undefined;\n constructor(kwargs?: SerializedFields, ..._args: never[]);\n toJSON(): Serialized;\n toJSONNotImplemented(): SerializedNotImplemented;\n}\n//# sourceMappingURL=serializable.d.ts.map"],"mappings":";;;UACiBC;;EAAAA,IAAAA,EAEPC,CAFOD;EAOAG,EAAAA,EAAAA,MAAAA,EAAAA;EAGAC,IAAAA,CAAAA,EAAAA,MAAAA;EAEAC,KAAAA,CAAAA,EAPLH,MAOKG,CAAAA,MAAAA,EAAAA,GAAAA,CAAwB;AAEzC;AAAyBF,UAPRA,qBAAAA,SAA8BH,cAOtBG,CAAAA,aAAAA,CAAAA,CAAAA;EAAwBC,MAAAA,EANrCL,gBAMqCK;;AAA2C,UAJ3EA,gBAAAA,SAAyBJ,cAIkD,CAAA,QAAA,CAAA,CAAA,CAK5F;AACiBS,UARAJ,wBAAAA,SAAiCL,cAQZ,CAAA,iBAAA,CAAA,CAAA,CAGtC;AAEeD,KAXHO,UAAAA,GAAaH,qBAWVJ,GAXkCK,gBAWlCL,GAXqDM,wBAWrDN;;;;;AAFuCU,iBAJ9BF,kBAAAA,CAI8BE,iBAAAA,EAAAA,OAJeD,YAIfC,CAAAA,EAAAA,MAAAA;AAAqB,UAH1DA,qBAAAA,CAG0D;;;uBAA7CD,YAAAA,YAAwBC;;aAEvCV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBA+BUA;;;;;;;;;;;;;;;uBAeAA;YACXO;0BACcD"}