AIContentExtensions extension

Extensions for working with collections of AIContent.

on
Annotations
  • @Source(name: 'AIContentExtensions.cs', namespace: 'Microsoft.Extensions.AI', repository: 'dotnet/extensions', path: 'src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/')

Methods

concatText() String

Available on Iterable<AIContent>, provided by the AIContentExtensions extension

Concatenates the text of all TextContent items.
firstOfTypeOrNull<T extends AIContent>() → T?

Available on Iterable<AIContent>, provided by the AIContentExtensions extension

Returns the first item of type T, or null if none exists.
ofType<T extends AIContent>() Iterable<T>

Available on Iterable<AIContent>, provided by the AIContentExtensions extension

Returns all items of type T.