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