OutputItemMessageBuilder Class

Definition

Scoped builder for a message-type output item. Manages the content index counter within the message and provides factory methods for content part scopes. Child content builders are auto-tracked so EmitDone() can build the final message from their accumulated state.

public class OutputItemMessageBuilder : Azure.AI.AgentServer.Responses.OutputItemBuilder<Azure.AI.AgentServer.Responses.Models.OutputItemMessage>
type OutputItemMessageBuilder = class
    inherit OutputItemBuilder<OutputItemMessage>
Public Class OutputItemMessageBuilder
Inherits OutputItemBuilder(Of OutputItemMessage)
Inheritance
OutputItemMessageBuilder

Constructors

Name Description
OutputItemMessageBuilder()

Initializes a new instance of OutputItemMessageBuilder for mocking.

Properties

Name Description
ItemId

The auto-generated item ID for this output item.

(Inherited from OutputItemBuilder<T>)
OutputIndex

The output index assigned to this output item.

(Inherited from OutputItemBuilder<T>)

Methods

Name Description
AddRefusalContent()

Creates a refusal content part scope with the next content index. The builder is auto-tracked for inclusion in EmitDone().

AddTextContent()

Creates a text content part scope with the next content index. The builder is auto-tracked for inclusion in EmitDone().

EmitAdded()

Produces a response.output_item.added event with an in-progress message output item.

EmitAdded(T)

Produces a response.output_item.added event wrapping the given item.

(Inherited from OutputItemBuilder<T>)
EmitDone()

Produces a response.output_item.done event with a completed message output item. The content list is built automatically from the tracked child content builders.

EmitDone(T)

Produces a response.output_item.done event wrapping the given item and tracks it in the response's output list.

(Inherited from OutputItemBuilder<T>)
RefusalContent(IAsyncEnumerable<String>, CancellationToken)

Convenience generator that yields the complete refusal content sub-item event sequence from streaming chunks (S-053, streaming mode per S-054). Each chunk is emitted as a delta immediately (S-055).

RefusalContent(String)

Convenience generator that yields the complete refusal content sub-item event sequence from a single string (S-053, complete-text mode per S-054).

TextContent(IAsyncEnumerable<String>, CancellationToken)

Convenience generator that yields the complete text content sub-item event sequence from streaming chunks (S-053, streaming mode per S-054). Each chunk is emitted as a delta immediately (S-055).

TextContent(String, IEnumerable<Annotation>)

Convenience generator that yields the complete text content sub-item event sequence from a single string with annotations. Each annotation is emitted as a response.output_text.annotation.added event after the text done event.

TextContent(String)

Convenience generator that yields the complete text content sub-item event sequence from a single string (S-053, complete-text mode per S-054).

Applies to