diff --git a/src/Encamina.Enmarcha.AI.Abstractions/ISemanticTextSplitter.cs b/src/Encamina.Enmarcha.AI.Abstractions/ISemanticTextSplitter.cs index 0593008..ba8af18 100644 --- a/src/Encamina.Enmarcha.AI.Abstractions/ISemanticTextSplitter.cs +++ b/src/Encamina.Enmarcha.AI.Abstractions/ISemanticTextSplitter.cs @@ -10,7 +10,7 @@ public interface ISemanticTextSplitter /// /// The input text to be split. /// A function to generate embeddings for a list of strings. - /// The to monitor for cancellation requests. The default is . + /// The to monitor for cancellation requests. /// A collection of text splits. - Task> SplitAsync(string text, Func, CancellationToken, Task>>> embeddingsGenerator, CancellationToken cancellationToken = default); + Task> SplitAsync(string text, Func, CancellationToken, Task>>> embeddingsGenerator, CancellationToken cancellationToken); } diff --git a/src/Encamina.Enmarcha.AI/TextSplitters/SemanticTextSplitter.cs b/src/Encamina.Enmarcha.AI/TextSplitters/SemanticTextSplitter.cs index 82f82cc..a39af64 100644 --- a/src/Encamina.Enmarcha.AI/TextSplitters/SemanticTextSplitter.cs +++ b/src/Encamina.Enmarcha.AI/TextSplitters/SemanticTextSplitter.cs @@ -31,7 +31,7 @@ public SemanticTextSplitter(IOptionsMonitor options } /// - public async Task> SplitAsync(string text, Func, CancellationToken, Task>>> embeddingsGenerator, CancellationToken cancellationToken = default) + public async Task> SplitAsync(string text, Func, CancellationToken, Task>>> embeddingsGenerator, CancellationToken cancellationToken) { // Code inspired by // https://github.com/run-llama/llama_index/blob/8ed753df970f068f6afc8a83fd51a1f40880de9e/llama-index-packs/llama-index-packs-node-parser-semantic-chunking/llama_index/packs/node_parser_semantic_chunking/base.py diff --git a/tst/Encamina.Enmarcha.AI.Tests/SemanticTextSplitterTests.cs b/tst/Encamina.Enmarcha.AI.Tests/SemanticTextSplitterTests.cs index 629a1b5..331534b 100644 --- a/tst/Encamina.Enmarcha.AI.Tests/SemanticTextSplitterTests.cs +++ b/tst/Encamina.Enmarcha.AI.Tests/SemanticTextSplitterTests.cs @@ -32,7 +32,7 @@ public async Task SplitText_Succeeds() }); // Act... - var splits = (await semanticTextSplitter.SplitAsync(text, embeddingsGeneratorMock.Object)).ToList(); + var splits = (await semanticTextSplitter.SplitAsync(text, embeddingsGeneratorMock.Object, CancellationToken.None)).ToList(); // Assert... Assert.Equal(2, splits.Count); @@ -50,7 +50,7 @@ public async Task SplitText_With_SingleSentence_Returns_OriginalText() var semanticTextSplitter = new SemanticTextSplitter(optionsMonitor); // Act... - var splits = (await semanticTextSplitter.SplitAsync(singleSentence, embeddingsGeneratorMock.Object)).ToList(); + var splits = (await semanticTextSplitter.SplitAsync(singleSentence, embeddingsGeneratorMock.Object, CancellationToken.None)).ToList(); // Assert... Assert.Single(splits);