Skip to content

Commit 0522282

Browse files
committed
test: update test
1 parent 4c93c8e commit 0522282

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/KernelMemory.DashScope/DashScopeTextGenerator.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ public async IAsyncEnumerable<GeneratedTextContent> GenerateTextAsync(
7272
var tokens = dashScopeClient.GetTextCompletionStreamAsync(request, cancellationToken);
7373
await foreach (var token in tokens)
7474
{
75-
if (cancellationToken.IsCancellationRequested)
76-
{
77-
break;
78-
}
79-
8075
yield return new GeneratedTextContent(
8176
token.Output.Text ?? string.Empty,
8277
token.Usage.ToKernelMemoryTokenUsage(modelId));

test/KernelMemory.DashScope.UnitTests/DashScopeTextGeneratorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public async Task TextGenerator_GenerateText_IncrementalGenerateAsync()
2626
var response = await generator.GenerateTextAsync(Cases.Text, Cases.TextGenerationOptions).ToListAsync();
2727

2828
// Assert
29-
response[0].Should().BeSameAs(
29+
response[0].Text.Should().BeSameAs(
3030
Cases.TextGenerationResponse.Output.Text,
3131
"generated text should mapped from output.text");
3232
captured.Should().BeEquivalentTo(
@@ -51,7 +51,7 @@ public async Task TextGenerator_DefaultsToZero_MapZeroToNullAsync()
5151
var response = await generator.GenerateTextAsync(Cases.Text, Cases.TextGenerationOptions).ToListAsync();
5252

5353
// Assert
54-
response[0].Should().BeSameAs(
54+
response[0].Text.Should().BeSameAs(
5555
Cases.TextGenerationResponse.Output.Text,
5656
"generated text should mapped from output.text");
5757
captured.Should().BeEquivalentTo(

0 commit comments

Comments
 (0)