From 3034544ca43cbb248b0f6ab4c4451c3ff4320046 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Thu, 9 Jan 2025 23:40:55 -0600 Subject: [PATCH] refactor: move local function below return --- src/AnthropicClient/AnthropicApiClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } ///