Method AIReduceAsync
- Namespace
- IntentSharp.Extensions
- Assembly
- IntentSharp.dll
AIReduceAsync<TIn, TOut>(IEnumerable<TIn>, string, AIRequestOptions?, CancellationToken)
Reduces the whole collection to a single TOut (a summary, a total, a verdict), using the ambient client.
public static Task<AIResult<TOut>> AIReduceAsync<TIn, TOut>(this IEnumerable<TIn> input, string intent, AIRequestOptions? options = null, CancellationToken cancellationToken = default)
Parameters
inputIEnumerable<TIn>intentstringoptionsAIRequestOptionscancellationTokenCancellationToken
Returns
- Task<AIResult<TOut>>
Type Parameters
TInTOut
Exceptions
- InvalidOperationException
No client is ambient on this async flow.