Table of Contents

Method GetDataSource

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

GetDataSource(string)

Retrieves a registered DataSource by its identifier.

public DataSource GetDataSource(string dataSourceIdentifier)

Parameters

dataSourceIdentifier string

The unique identifier of the DataSource to retrieve.

Returns

DataSource

The DataSource with the specified identifier.

Examples

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

ragEngine.ImportText("Some content.", "myData", "section1");

DataSource ds = ragEngine.GetDataSource("myData");
Console.WriteLine($"DataSource '{ds.Identifier}' has {ds.Sections.Count} section(s).");

Exceptions

ArgumentNullException

Thrown if dataSourceIdentifier is null, empty, or whitespace.

KeyNotFoundException

Thrown if no DataSource with the specified identifier is found.

Share