RefusalContentBuilder Class

Definition

Scoped builder for a refusal content part within a message. Owns its full lifecycle: EmitAddedEmitDelta (0+) → EmitRefusalDoneEmitDone.

public class RefusalContentBuilder
type RefusalContentBuilder = class
Public Class RefusalContentBuilder
Inheritance
RefusalContentBuilder

Constructors

Name Description
RefusalContentBuilder()

Initializes a new instance of RefusalContentBuilder for mocking.

Properties

Name Description
ContentIndex

The content index assigned to this refusal content part.

FinalRefusal

The final refusal text set by EmitRefusalDone(String). Null if not yet finalized.

Methods

Name Description
EmitAdded()

Produces a response.content_part.added event with an empty refusal content part.

EmitDelta(String)

Produces a response.refusal.delta event with the given refusal text chunk.

EmitDone()

Produces a response.content_part.done event, closing this content part. Must be called after EmitRefusalDone(String).

EmitRefusalDone(String)

Produces a response.refusal.done event with the final complete refusal text. Call this after all deltas have been emitted and before EmitDone().

Applies to