Documentation
Table of Contents

Class AmbientAIExtensions

Namespace
IntentSharp.Extensions
Assembly
IntentSharp.dll

The same operations as AIExtensions without the client parameter. They use the client made ambient with AsAmbient() and throw with guidance when none is active.

public static class AmbientAIExtensions
Inheritance
object
AmbientAIExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

Methods

AIAsync(object?, string, AIRequestOptions?, CancellationToken)

Applies the intent to the value with the ambient client and returns text.

AIAsync<T>(object?, string, AIRequestOptions?, CancellationToken)

Applies the intent to the value with the ambient client and returns a verified T.

AIClassifyAsync<TEnum>(object?, string?, AIRequestOptions?, CancellationToken)

Classifies the value into exactly one of the enum's members, using the ambient client.

AIConvertAsync<T>(object?, AIRequestOptions?, CancellationToken)

Converts the value to T with a default conversion intent, using the ambient client.

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

Keeps the elements that satisfy the intent, using the ambient client. The original objects are returned unchanged.

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.

AIMapAsync<TIn, TOut>(IEnumerable<TIn>, string, AIRequestOptions?, CancellationToken)

Transforms each element into a TOut with the ambient client. The result has the same length and order as the input; a length mismatch fails verification.

AIMapValuesAsync<TKey, TIn, TOut>(IDictionary<TKey, TIn>, string, AIRequestOptions?, CancellationToken)

Transforms a dictionary's values with the ambient client, keeping its keys. Missing or extra keys fail verification, and so does a null value unless TOut is a Nullable<T> value type.

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.

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

Orders the elements according to the intent, using the ambient client. Every element appears exactly once.