1 type derived from ContentBlock
Microsoft.AspNetCore.Components.AI (1)
Blocks\RichContentBlock.cs (1)
11public class RichContentBlock : ContentBlock
41 references to ContentBlock
Microsoft.AspNetCore.Components.AI (41)
Blocks\BlockLifecycleState.cs (1)
7/// Describes where a <see cref="ContentBlock"/> is in its streaming lifecycle.
Blocks\ContentBlockChangedSubscription.cs (3)
7/// Represents a subscription to <see cref="ContentBlock.OnChanged(Action)"/>. 12private readonly ContentBlock _owner; 15internal ContentBlockChangedSubscription(ContentBlock owner, Action callback)
Components\BlockContainer.cs (2)
9private readonly ContentBlock _block; 13internal BlockContainer(ContentBlock block, MessageListContext listContext, Action requestRender)
Components\BlockRenderer.cs (1)
20public class BlockRenderer<TBlock> : IComponent, IDisposable where TBlock : ContentBlock
Components\BlockRendererRegistration.cs (2)
10public Func<ContentBlock, bool>? When { get; init; } 12public required Func<ContentBlock, RenderFragment> Render { get; init; }
Components\ConversationTurnRenderer.cs (3)
35foreach (var block in turn.RequestBlocks) 39foreach (var block in turn.ResponseBlocks) 45private void OnBlockAdded(ContentBlock block)
Components\MessageListContext.cs (1)
22public RenderFragment RenderBlock(ContentBlock block)
Engine\AgentContext.cs (5)
25private readonly List<Action<ConversationTurn, ContentBlock>> _blockAddedCallbacks = new(); 160public IDisposable RegisterOnBlockAdded(Action<ConversationTurn, ContentBlock> callback) 164return new CallbackRegistration<Action<ConversationTurn, ContentBlock>>(_blockAddedCallbacks, callback); 198await foreach (var block in _agent.SendMessageAsync(message, cancellationToken) 261private void NotifyBlockAdded(ConversationTurn turn, ContentBlock block)
Engine\ConversationTurn.cs (6)
12private readonly List<ContentBlock> _requestBlocks = new(); 13private readonly List<ContentBlock> _responseBlocks = new(); 23public IReadOnlyList<ContentBlock> RequestBlocks => _requestBlocks; 28public IReadOnlyList<ContentBlock> ResponseBlocks => _responseBlocks; 30internal void AddRequestBlock(ContentBlock block) 35internal void AddResponseBlock(ContentBlock block)
Engine\UIAgent.cs (6)
96/// they are created; a block keeps changing (raising <see cref="ContentBlock.OnChanged(Action)"/>) 102public async IAsyncEnumerable<ContentBlock> SendMessageAsync( 118await foreach (var block in pipeline.Process(userUpdate, cancellationToken).ConfigureAwait(false)) 122foreach (var block in pipeline.Finalize()) 140await foreach (var block in pipeline.Process(update, cancellationToken).ConfigureAwait(false)) 148foreach (var block in pipeline.Finalize())
Pipeline\BlockMappingPipeline.cs (5)
36internal async IAsyncEnumerable<ContentBlock> Process( 99var emitBlock = activeEntry.Block; 127internal IReadOnlyList<ContentBlock> Finalize() 138return Array.Empty<ContentBlock>(); 141private static void ThrowIfIdMissing(ContentBlock block)
Pipeline\BlockMappingResult.cs (3)
16internal ContentBlock? Block { get; } 20private BlockMappingResult(ResultKind kind, ContentBlock? block, TState? state) 39public static BlockMappingResult<TState> Emit(ContentBlock block, TState state)
Pipeline\HandlerEntry.cs (2)
35ContentBlock block) 42public ContentBlock Block { get; }
Pipeline\IActiveEntry.cs (1)
8ContentBlock Block { get; }