Method AIClassifyAsync
- Namespace
- IntentSharp.Extensions
- Assembly
- IntentSharp.dll
AIClassifyAsync<TEnum>(object?, string?, AIRequestOptions?, CancellationToken)
Classifies the value into exactly one of the enum's members, using the ambient client.
public static Task<AIResult<TEnum>> AIClassifyAsync<TEnum>(this object? input, string? criteria = null, AIRequestOptions? options = null, CancellationToken cancellationToken = default) where TEnum : struct, Enum
Parameters
inputobjectThe value to classify.
criteriastringHow to choose between the members, added to the intent. Null or blank adds nothing.
optionsAIRequestOptionsPer-request overrides, or null.
cancellationTokenCancellationTokenCancels the request.
Returns
- Task<AIResult<TEnum>>
Type Parameters
TEnum
Exceptions
- InvalidOperationException
No client is ambient on this async flow.