OutputItemMessageBuilder.TextContent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| 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). |
| 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 |
TextContent(String)
- Source:
- OutputItemMessageBuilder.cs
Convenience generator that yields the complete text content sub-item event sequence from a single string (S-053, complete-text mode per S-054).
public virtual System.Collections.Generic.IEnumerable<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent> TextContent(string text);
abstract member TextContent : string -> seq<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent>
override this.TextContent : string -> seq<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent>
Public Overridable Function TextContent (text As String) As IEnumerable(Of ResponseStreamEvent)
Parameters
- text
- String
The complete text to emit.
Returns
An enumerable of events: content_part.added → output_text.delta → output_text.done → content_part.done.
Applies to
TextContent(IAsyncEnumerable<String>, CancellationToken)
- Source:
- OutputItemMessageBuilder.cs
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).
public virtual System.Collections.Generic.IAsyncEnumerable<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent> TextContent(System.Collections.Generic.IAsyncEnumerable<string> chunks, System.Threading.CancellationToken cancellationToken = default);
abstract member TextContent : System.Collections.Generic.IAsyncEnumerable<string> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent>
override this.TextContent : System.Collections.Generic.IAsyncEnumerable<string> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent>
Public Overridable Function TextContent (chunks As IAsyncEnumerable(Of String), Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ResponseStreamEvent)
Parameters
- chunks
- IAsyncEnumerable<String>
An async enumerable of text chunks.
- cancellationToken
- CancellationToken
A token to cancel iteration.
Returns
An async enumerable of events: content_part.added → N × output_text.delta → output_text.done → content_part.done.
Applies to
TextContent(String, IEnumerable<Annotation>)
- Source:
- OutputItemMessageBuilder.cs
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.
public virtual System.Collections.Generic.IEnumerable<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent> TextContent(string text, System.Collections.Generic.IEnumerable<Azure.AI.AgentServer.Responses.Models.Annotation> annotations);
abstract member TextContent : string * seq<Azure.AI.AgentServer.Responses.Models.Annotation> -> seq<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent>
override this.TextContent : string * seq<Azure.AI.AgentServer.Responses.Models.Annotation> -> seq<Azure.AI.AgentServer.Responses.Models.ResponseStreamEvent>
Public Iterator Overridable Function TextContent (text As String, annotations As IEnumerable(Of Annotation)) As IEnumerable(Of ResponseStreamEvent)
Parameters
- text
- String
The complete text to emit.
- annotations
- IEnumerable<Annotation>
The annotations to attach to this text content part.
Returns
An enumerable of events: content_part.added → output_text.delta → output_text.done → N × annotation.added → content_part.done.