Table of Contents

Method Deserialize

Namespace
LMKit.Data
Assembly
LM-Kit.NET.dll

Deserialize(string, LLM)

Deserializes the binary data from the specified file path into a DataSource instance using the provided model for context. This method reconstructs a DataSource object from its binary form, applying the model to interpret or configure the data appropriately.

public static DataSource Deserialize(string dataSourcePath, LLM model)

Parameters

dataSourcePath string

The path to the binary file containing the serialized DataSource. The path must not be null or empty, and the file should be in a valid binary format produced by a corresponding serialization method.

model LLM

The model used to assist in the deserialization process, including configuration settings or schema definitions necessary for correctly rebuilding the DataSource instance.

Returns

DataSource

A new instance of DataSource reconstructed from the provided binary data. Returns null if deserialization fails.

Exceptions

ArgumentNullException

Thrown if dataSourcePath is null or empty.

FileNotFoundException

Thrown if the file specified by dataSourcePath does not exist.

Deserialize(byte[], LLM)

Deserializes the given binary data into a DataSource instance using the specified model for context.
This method reconstructs a DataSource object from its binary form, applying the model to interpret or configure the data appropriately.

public static DataSource Deserialize(byte[] data, LLM model)

Parameters

data byte[]

The binary data representing a serialized DataSource. This data must not be null and should be a valid binary format previously produced by a corresponding serialize method.

model LLM

The model used to assist in the deserialization process. This might include configuration settings or schema definitions needed to correctly rebuild the DataSource instance.

Returns

DataSource

A new instance of DataSource that has been reconstructed from the provided binary data. Returns null if deserialization fails.

Exceptions

ArgumentNullException

Thrown if either data or model is null.

Deserialize(Stream, LLM)

Deserializes a DataSource from a stream using the provided model for context.
This method reconstructs a DataSource object from its binary form, applying the model to interpret or configure the data appropriately.

public static DataSource Deserialize(Stream stream, LLM model)

Parameters

stream Stream

The stream containing the binary data of a serialized DataSource. The stream must be readable and must not be null.

model LLM

The model used to assist in the deserialization process, which may include settings or definitions essential for reconstructing the DataSource accurately. This parameter must not be null.

Returns

DataSource

A new instance of DataSource reconstructed from the data in the stream. If deserialization fails, it may return null or throw an exception, depending on the failure condition.

Exceptions

ArgumentNullException

Thrown if either stream or model is null, as both are required for successful deserialization.

ArgumentException

Thrown if the stream is not readable.

InvalidDataException

Thrown when the data in the stream does not represent a valid serialized DataSource, or if errors occur during the deserialization process.