Documentation
Table of Contents

Method AIGroupAsync

Namespace
IntentSharp.Extensions
Assembly
IntentSharp.dll

AIGroupAsync<T>(IEnumerable<T>, string, AIRequestOptions?, CancellationToken)

Groups the elements by the intent, using the ambient client. Returns group labels chosen by the model mapped to the original objects.

public static Task<AIResult<Dictionary<string, List<T>>>> AIGroupAsync<T>(this IEnumerable<T> input, string intent, AIRequestOptions? options = null, CancellationToken cancellationToken = default)

Parameters

input IEnumerable<T>
intent string
options AIRequestOptions
cancellationToken CancellationToken

Returns

Task<AIResult<Dictionary<string, List<T>>>>

Type Parameters

T

Exceptions

InvalidOperationException

No client is ambient on this async flow.