Table of Contents

Method ClearDataSources

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

ClearDataSources()

Removes all DataSource objects managed by this instance, leaving no registered data sources.

public void ClearDataSources()

Examples

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

class Example
{
    static void Main()
    {
        LM embeddingModel = new LM(new Uri("https://example-embedding-uri.com"));
        RagEngine ragEngine = new RagEngine(embeddingModel);

        ragEngine.AddDataSource(new DataSource("sourceA"));
        ragEngine.AddDataSource(new DataSource("sourceB"));

        Console.WriteLine($"Number of DataSources before clearing: {ragEngine.DataSources.Count}");

        ragEngine.ClearDataSources();

        Console.WriteLine($"Number of DataSources after clearing: {ragEngine.DataSources.Count}");
    }
}