Class DataSource
Represents a repository for various data sources, encapsulating the content from diverse sources such as documents, web pages, and other data-rich environments.
This class provides a unified interface to interact with different types of data in a consistent manner.
public sealed class DataSource
- Inheritance
-
DataSource
- Inherited Members
Remarks
In LMKit, the hierarchy of data structures is organized as follows: a DataSource contains a collection of Section objects, each of which can hold a collection of TextPartition instances.
Properties
- Identifier
Gets the unique identifier for this instance.
- Metadata
Gets the metadata associated with this instance.
- Sections
Gets a read-only collection of sections that make up this instance.
Methods
- Clone()
Creates a deep clone of this DataSource instance.
A deep clone involves creating a new instance of the class with all of the original object's data copied over, including a recursive copy of all complex properties, thus ensuring no references to the mutable objects of the original instance are shared.
- 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.
- 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.
- 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.
- GetSectionByIdentifier(string)
Retrieves a Section object from this instance based on the specified identifier.
- Serialize()
Serializes this instance into a binary format and returns the resulting data as a byte array.
- Serialize(Stream)
Serializes this instance into a binary format and writes it to the specified stream.
- Serialize(string)
Serializes this instance into a binary format and writes it to the specified file path. This method converts the current instance into its binary representation and writes the data to a file at the given path.