Documentation
Table of Contents

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

input object

The value to classify.

criteria string

How to choose between the members, added to the intent. Null or blank adds nothing.

options AIRequestOptions

Per-request overrides, or null.

cancellationToken CancellationToken

Cancels the request.

Returns

Task<AIResult<TEnum>>

Type Parameters

TEnum

Exceptions

InvalidOperationException

No client is ambient on this async flow.