diff --git a/src/AnthropicClient/AnthropicApiClient.cs b/src/AnthropicClient/AnthropicApiClient.cs index cb5f0c5..fbe11c6 100644 --- a/src/AnthropicClient/AnthropicApiClient.cs +++ b/src/AnthropicClient/AnthropicApiClient.cs @@ -356,7 +356,9 @@ public class AnthropicApiClient : IAnthropicApiClient return AnthropicResult>.Failure(error, anthropicHeaders); } - async IAsyncEnumerable ReadResults() + return AnthropicResult>.Success(ReadResultsAsync(), anthropicHeaders); + + async IAsyncEnumerable ReadResultsAsync() { using var responseContent = await response.Content.ReadAsStreamAsync(); using var streamReader = new StreamReader(responseContent); @@ -371,8 +373,6 @@ public class AnthropicApiClient : IAnthropicApiClient line = await streamReader.ReadLineAsync(); } } - - return AnthropicResult>.Success(ReadResults(), anthropicHeaders); } ///