Table of Contents

Method CreateInMemoryDataSource

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

CreateInMemoryDataSource(string, LM, MetadataCollection)

Creates a new in-memory DataSource instance with the specified identifier and language model. This instance can subsequently be saved to a file using one of the Serialize methods.

public static DataSource CreateInMemoryDataSource(string identifier, LM model, MetadataCollection metadata = null)

Parameters

identifier string

The unique identifier for the data source.

model LM

The language model to be associated with the data source.

metadata MetadataCollection

Optional metadata to be associated with the data source.

Returns

DataSource

A new in-memory DataSource instance that can later be persisted to disk via the Serialize(string) or Serialize(Stream) methods.

CreateInMemoryDataSource(string, int, MetadataCollection)

Creates a new in-memory DataSource instance with the specified identifier and embedding size. This instance can subsequently be saved to a file using one of the Serialize methods.

public static DataSource CreateInMemoryDataSource(string identifier, int embeddingSize, MetadataCollection metadata = null)

Parameters

identifier string

The unique identifier for the data source.

embeddingSize int

The dimensionality of the vector embeddings for this data source.

metadata MetadataCollection

Optional metadata to be associated with the data source.

Returns

DataSource

A new in-memory DataSource instance that can later be persisted to disk via the Serialize(string) or Serialize(Stream) methods.

Exceptions

ArgumentNullException

Thrown if identifier is null or empty.