Documentation
Table of Contents

Method AIMapValuesAsync

Namespace
IntentSharp.Extensions
Assembly
IntentSharp.dll

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.

public static Task<AIResult<Dictionary<TKey, TOut>>> AIMapValuesAsync<TKey, TIn, TOut>(this IDictionary<TKey, TIn> input, string intent, AIRequestOptions? options = null, CancellationToken cancellationToken = default) where TKey : notnull

Parameters

input IDictionary<TKey, TIn>
intent string
options AIRequestOptions
cancellationToken CancellationToken

Returns

Task<AIResult<Dictionary<TKey, TOut>>>

Type Parameters

TKey
TIn
TOut

Exceptions

InvalidOperationException

No client is ambient on this async flow.

ArgumentException

Two or more keys have the same string form, so the reply could not be mapped back.