Skip to content

Commit

Permalink
fix: Removed generic GetAwaiter extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Nov 1, 2024
1 parent 0c31a0d commit 0b042c2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/libs/Ollama/OllamaApiClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,23 @@ public static TaskAwaiter<GenerateChatCompletionResponse> GetAwaiter(
/// </summary>
/// <param name="enumerable"></param>
/// <returns></returns>
public static async Task<IReadOnlyList<T>> WaitAsync<T>(
this IAsyncEnumerable<T> enumerable)
public static async Task<IReadOnlyList<PullModelResponse>> WaitAsync(
this IAsyncEnumerable<PullModelResponse> enumerable)
{
enumerable = enumerable ?? throw new ArgumentNullException(nameof(enumerable));

var responses = new List<T>();
var responses = new List<PullModelResponse>();
await foreach (var response in enumerable.ConfigureAwait(false))
{
responses.Add(response);
}

return responses;
}

/// <inheritdoc cref="WaitAsync{T}(IAsyncEnumerable{T})"/>
public static TaskAwaiter<IReadOnlyList<T>> GetAwaiter<T>(
this IAsyncEnumerable<T> enumerable)
/// <inheritdoc cref="WaitAsync(IAsyncEnumerable{PullModelResponse})"/>
public static TaskAwaiter<IReadOnlyList<PullModelResponse>> GetAwaiter(
this IAsyncEnumerable<PullModelResponse> enumerable)
{
enumerable = enumerable ?? throw new ArgumentNullException(nameof(enumerable));

Expand Down

0 comments on commit 0b042c2

Please sign in to comment.