Table of Contents

Method AddDataSource

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

AddDataSource(DataSource)

Registers a new DataSource with this engine for retrieval operations.

public void AddDataSource(DataSource dataSource)

Parameters

dataSource DataSource

The DataSource to register. Must not be null or already registered.

Examples

LM embeddingModel = LM.LoadFromModelID("embeddinggemma-300m");
RagEngine ragEngine = new RagEngine(embeddingModel);

DataSource dataSource = new DataSource("myUniqueData");
ragEngine.AddDataSource(dataSource);

Console.WriteLine("DataSource added successfully.");

Exceptions

ArgumentNullException

Thrown if dataSource is null.

ArgumentException

Thrown if dataSource is already registered with this engine.

InvalidModelException

Thrown if the DataSource model is incompatible with the engine's embedding model.