Table of Contents

Method RemoveDataSource

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

RemoveDataSource(DataSource)

Attempts to remove a specified DataSource from management. Returns true if removed, false otherwise.

public bool RemoveDataSource(DataSource dataSource)

Parameters

dataSource DataSource

The non-null DataSource to remove.

Returns

bool

True if removed, false if not found.

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);

        DataSource ds = new DataSource("removableSource");
        ragEngine.AddDataSource(ds);

        bool removed = ragEngine.RemoveDataSource(ds);
        Console.WriteLine("Was DataSource removed? " + removed);
    }
}

Exceptions

ArgumentNullException

Thrown if dataSource is null.