Table of Contents

Property DataSources

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

DataSources

Gets a read-only collection of DataSource objects that represent the imported content repositories used for retrieval operations.

public IReadOnlyList<DataSource> DataSources { get; }

Property Value

IReadOnlyList<DataSource>

Examples

using LMKit.Data;
using LMKit.Model;
using LMKit.Retrieval;
using System;

class Example
{
    static void Main()
    {
        // Assume 'embeddingModel' is a valid LM reference.
        LM embeddingModel = new LM(new Uri("https://example-model-uri.com"));

        RagEngine ragEngine = new RagEngine(embeddingModel);

        // The data sources list is initially empty.
        Console.WriteLine($"Initial DataSources count: {ragEngine.DataSources.Count}");

        // Add a DataSource for demonstration:
        DataSource ds = new DataSource("myDataSource");
        ragEngine.AddDataSource(ds);

        // Now the DataSources property should reflect the newly added item.
        Console.WriteLine($"Updated DataSources count: {ragEngine.DataSources.Count}");
    }
}