Skip to content

Commit fad6df5

Browse files
gewarrenstephentoub
authored andcommitted
Doc updates (#6930)
* doc updates --------- Co-authored-by: Stephen Toub <[email protected]>
1 parent 9ff7d56 commit fad6df5

File tree

8 files changed

+37
-38
lines changed

8 files changed

+37
-38
lines changed

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatOptions.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,24 @@ protected ChatOptions(ChatOptions? other)
133133
public IList<string>? StopSequences { get; set; }
134134

135135
/// <summary>
136-
/// Gets or sets a flag to indicate whether a single response is allowed to include multiple tool calls.
137-
/// If <see langword="false"/>, the <see cref="IChatClient"/> is asked to return a maximum of one tool call per request.
138-
/// If <see langword="true"/>, there is no limit.
139-
/// If <see langword="null"/>, the provider may select its own default.
136+
/// Gets or sets a value that indicates whether a single response is allowed to include multiple tool calls.
140137
/// </summary>
138+
/// <value>
139+
/// <see langword="true"/> for no limit. <see langword="false"/> if the <see cref="IChatClient"/> is asked to return a maximum of one tool call per request. If <see langword="null"/>, the provider can select its own default.
140+
/// </value>
141141
/// <remarks>
142142
/// <para>
143143
/// When used with function calling middleware, this does not affect the ability to perform multiple function calls in sequence.
144144
/// It only affects the number of function calls within a single iteration of the function calling loop.
145145
/// </para>
146146
/// <para>
147-
/// The underlying provider is not guaranteed to support or honor this flag. For example it may choose to ignore it and return multiple tool calls regardless.
147+
/// The underlying provider is not guaranteed to support or honor this flag. For example it might choose to ignore it and return multiple tool calls regardless.
148148
/// </para>
149149
/// </remarks>
150150
public bool? AllowMultipleToolCalls { get; set; }
151151

152152
/// <summary>Gets or sets the tool mode for the chat request.</summary>
153-
/// <remarks>The default value is <see langword="null"/>, which is treated the same as <see cref="ChatToolMode.Auto"/>.</remarks>
153+
/// <value>The default is <see langword="null"/>, which is treated the same as <see cref="ChatToolMode.Auto"/>.</value>
154154
public ChatToolMode? ToolMode { get; set; }
155155

156156
/// <summary>Gets or sets the list of tools to include with a chat request.</summary>
@@ -165,12 +165,12 @@ protected ChatOptions(ChatOptions? other)
165165
/// and polled for completion by non-streaming APIs.
166166
/// </para>
167167
/// <para>
168-
/// When this property is set to true, non-streaming APIs may start a background operation and return an initial
168+
/// When this property is set to <see langword="true" />, non-streaming APIs have permission to start a background operation and return an initial
169169
/// response with a continuation token. Subsequent calls to the same API should be made in a polling manner with
170170
/// the continuation token to get the final result of the operation.
171171
/// </para>
172172
/// <para>
173-
/// When this property is set to true, streaming APIs may also start a background operation and begin streaming
173+
/// When this property is set to <see langword="true" />, streaming APIs are also permitted to start a background operation and begin streaming
174174
/// response updates until the operation is completed. If the streaming connection is interrupted, the
175175
/// continuation token obtained from the last update that has one should be supplied to a subsequent call to the same streaming API
176176
/// to resume the stream from the point of interruption and continue receiving updates until the operation is completed.
@@ -189,10 +189,10 @@ protected ChatOptions(ChatOptions? other)
189189
/// This property is used for background responses that can be activated via the <see cref="AllowBackgroundResponses"/>
190190
/// property if the <see cref="IChatClient"/> implementation supports them.
191191
/// Streamed background responses, such as those returned by default by <see cref="IChatClient.GetStreamingResponseAsync"/>,
192-
/// can be resumed if interrupted. This means that a continuation token obtained from the <see cref="ChatResponseUpdate.ContinuationToken"/>
192+
/// can be resumed if interrupted. This means that a continuation token obtained from the <see cref="ChatResponseUpdate.ContinuationToken"/>
193193
/// of an update just before the interruption occurred can be passed to this property to resume the stream from the point of interruption.
194194
/// Non-streamed background responses, such as those returned by <see cref="IChatClient.GetResponseAsync"/>,
195-
/// can be polled for completion by obtaining the token from the <see cref="ChatResponse.ContinuationToken"/> property
195+
/// can be polled for completion by obtaining the token from the <see cref="ChatResponse.ContinuationToken"/> property
196196
/// and passing it to this property on subsequent calls to <see cref="IChatClient.GetResponseAsync"/>.
197197
/// </remarks>
198198
[Experimental("MEAI001")]
@@ -203,17 +203,17 @@ protected ChatOptions(ChatOptions? other)
203203
/// Gets or sets a callback responsible for creating the raw representation of the chat options from an underlying implementation.
204204
/// </summary>
205205
/// <remarks>
206-
/// The underlying <see cref="IChatClient" /> implementation may have its own representation of options.
206+
/// The underlying <see cref="IChatClient" /> implementation might have its own representation of options.
207207
/// When <see cref="IChatClient.GetResponseAsync" /> or <see cref="IChatClient.GetStreamingResponseAsync" />
208-
/// is invoked with a <see cref="ChatOptions" />, that implementation may convert the provided options into
208+
/// is invoked with a <see cref="ChatOptions" />, that implementation might convert the provided options into
209209
/// its own representation in order to use it while performing the operation. For situations where a consumer knows
210210
/// which concrete <see cref="IChatClient" /> is being used and how it represents options, a new instance of that
211-
/// implementation-specific options type may be returned by this callback, for the <see cref="IChatClient" />
212-
/// implementation to use instead of creating a new instance. Such implementations may mutate the supplied options
211+
/// implementation-specific options type can be returned by this callback for the <see cref="IChatClient" />
212+
/// implementation to use, instead of creating a new instance. Such implementations might mutate the supplied options
213213
/// instance further based on other settings supplied on this <see cref="ChatOptions" /> instance or from other inputs,
214-
/// like the enumerable of <see cref="ChatMessage"/>s, therefore, it is <b>strongly recommended</b> to not return shared instances
214+
/// like the enumerable of <see cref="ChatMessage"/>s. Therefore, it is <b>strongly recommended</b> to not return shared instances
215215
/// and instead make the callback return a new instance on each call.
216-
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly-typed
216+
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly typed
217217
/// properties on <see cref="ChatOptions" />.
218218
/// </remarks>
219219
[JsonIgnore]

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponse.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ namespace Microsoft.Extensions.AI;
1212
/// <summary>Represents the response to a chat request.</summary>
1313
/// <remarks>
1414
/// <see cref="ChatResponse"/> provides one or more response messages and metadata about the response.
15-
/// A typical response will contain a single message, however a response may contain multiple messages
15+
/// A typical response will contain a single message, however a response might contain multiple messages
1616
/// in a variety of scenarios. For example, if automatic function calling is employed, such that a single
17-
/// request to a <see cref="IChatClient"/> may actually generate multiple roundtrips to an inner <see cref="IChatClient"/>
18-
/// it uses, all of the involved messages may be surfaced as part of the final <see cref="ChatResponse"/>.
17+
/// request to a <see cref="IChatClient"/> might actually generate multiple round-trips to an inner <see cref="IChatClient"/>
18+
/// it uses, all of the involved messages might be surfaced as part of the final <see cref="ChatResponse"/>.
1919
/// </remarks>
2020
public class ChatResponse
2121
{
@@ -69,8 +69,7 @@ public IList<ChatMessage> Messages
6969
/// the input messages supplied to <see cref="IChatClient.GetResponseAsync"/> need only be the additional messages beyond
7070
/// what's already stored. If this property is non-<see langword="null"/>, it represents an identifier for that state,
7171
/// and it should be used in a subsequent <see cref="ChatOptions.ConversationId"/> instead of supplying the same messages
72-
/// (and this <see cref="ChatResponse"/>'s message) as part of the <c>messages</c> parameter. Note that the value may
73-
/// or may not differ on every response, depending on whether the underlying provider uses a fixed ID for each conversation
72+
/// (and this <see cref="ChatResponse"/>'s message) as part of the <c>messages</c> parameter. Note that the value might differ on every response, depending on whether the underlying provider uses a fixed ID for each conversation
7473
/// or updates it for each message.
7574
/// </remarks>
7675
/// <related type="Article" href="https://learn.microsoft.com/dotnet/ai/microsoft-extensions-ai#stateless-vs-stateful-clients">Stateless vs. stateful clients.</related>
@@ -95,7 +94,7 @@ public IList<ChatMessage> Messages
9594
/// and the result of the response has not been obtained yet. If the response has completed and the result has been obtained,
9695
/// the token will be <see langword="null"/>.
9796
/// <para>
98-
/// This property should be used in conjunction with <see cref="ChatOptions.ContinuationToken"/> to
97+
/// This property should be used in conjunction with <see cref="ChatOptions.ContinuationToken"/> to
9998
/// continue to poll for the completion of the response. Pass this token to
10099
/// <see cref="ChatOptions.ContinuationToken"/> on subsequent calls to <see cref="IChatClient.GetResponseAsync"/>
101100
/// to poll for completion.
@@ -121,7 +120,7 @@ public IList<ChatMessage> Messages
121120
public override string ToString() => Text;
122121

123122
/// <summary>Creates an array of <see cref="ChatResponseUpdate" /> instances that represent this <see cref="ChatResponse" />.</summary>
124-
/// <returns>An array of <see cref="ChatResponseUpdate" /> instances that may be used to represent this <see cref="ChatResponse" />.</returns>
123+
/// <returns>An array of <see cref="ChatResponseUpdate" /> instances that can be used to represent this <see cref="ChatResponse" />.</returns>
125124
public ChatResponseUpdate[] ToChatResponseUpdates()
126125
{
127126
ChatResponseUpdate? extra = null;

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponseUpdate.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Microsoft.Extensions.AI;
2222
/// The relationship between <see cref="ChatResponse"/> and <see cref="ChatResponseUpdate"/> is
2323
/// codified in the <see cref="ChatResponseExtensions.ToChatResponseAsync"/> and
2424
/// <see cref="ChatResponse.ToChatResponseUpdates"/>, which enable bidirectional conversions
25-
/// between the two. Note, however, that the provided conversions may be lossy, for example if multiple
25+
/// between the two. Note, however, that the provided conversions might be lossy, for example, if multiple
2626
/// updates all have different <see cref="RawRepresentation"/> objects whereas there's only one slot for
2727
/// such an object available in <see cref="ChatResponse.RawRepresentation"/>. Similarly, if different
2828
/// updates provide different values for properties like <see cref="ModelId"/>,
@@ -100,12 +100,12 @@ public IList<AIContent> Contents
100100

101101
/// <summary>Gets or sets the ID of the message of which this update is a part.</summary>
102102
/// <remarks>
103-
/// A single streaming response may be composed of multiple messages, each of which may be represented
103+
/// A single streaming response might be composed of multiple messages, each of which might be represented
104104
/// by multiple updates. This property is used to group those updates together into messages.
105105
///
106-
/// Some providers may consider streaming responses to be a single message, and in that case
107-
/// the value of this property may be the same as the response ID.
108-
///
106+
/// Some providers might consider streaming responses to be a single message, and in that case
107+
/// the value of this property might be the same as the response ID.
108+
///
109109
/// This value is used when <see cref="ChatResponseExtensions.ToChatResponseAsync(IAsyncEnumerable{ChatResponseUpdate}, System.Threading.CancellationToken)"/>
110110
/// groups <see cref="ChatResponseUpdate"/> instances into <see cref="ChatMessage"/> instances.
111111
/// The value must be unique to each call to the underlying provider, and must be shared by
@@ -119,7 +119,7 @@ public IList<AIContent> Contents
119119
/// the input messages supplied to <see cref="IChatClient.GetStreamingResponseAsync"/> need only be the additional messages beyond
120120
/// what's already stored. If this property is non-<see langword="null"/>, it represents an identifier for that state,
121121
/// and it should be used in a subsequent <see cref="ChatOptions.ConversationId"/> instead of supplying the same messages
122-
/// (and this streaming message) as part of the <c>messages</c> parameter. Note that the value may or may not differ on every
122+
/// (and this streaming message) as part of the <c>messages</c> parameter. Note that the value might differ on every
123123
/// response, depending on whether the underlying provider uses a fixed ID for each conversation or updates it for each message.
124124
/// </remarks>
125125
public string? ConversationId { get; set; }
@@ -138,9 +138,9 @@ public IList<AIContent> Contents
138138

139139
/// <summary>Gets or sets the continuation token for resuming the streamed chat response of which this update is a part.</summary>
140140
/// <remarks>
141-
/// <see cref="IChatClient"/> implementations that support background responses will return
142-
/// a continuation token on each update if background responses are allowed in <see cref="ChatOptions.AllowBackgroundResponses"/>
143-
/// except of the last update, for which the token will be <see langword="null"/>.
141+
/// <see cref="IChatClient"/> implementations that support background responses return
142+
/// a continuation token on each update if background responses are allowed in <see cref="ChatOptions.AllowBackgroundResponses"/>.
143+
/// However, for the last update, the token will be <see langword="null"/>.
144144
/// <para>
145145
/// This property should be used for stream resumption, where the continuation token of the latest received update should be
146146
/// passed to <see cref="ChatOptions.ContinuationToken"/> on subsequent calls to <see cref="IChatClient.GetStreamingResponseAsync"/>

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/IChatClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(
6262
/// <returns>The found object, otherwise <see langword="null"/>.</returns>
6363
/// <exception cref="ArgumentNullException"><paramref name="serviceType"/> is <see langword="null"/>.</exception>
6464
/// <remarks>
65-
/// The purpose of this method is to allow for the retrieval of strongly-typed services that might be provided by the <see cref="IChatClient"/>,
65+
/// The purpose of this method is to allow for the retrieval of strongly typed services that might be provided by the <see cref="IChatClient"/>,
6666
/// including itself or any services it might be wrapping. For example, to access the <see cref="ChatClientMetadata"/> for the instance,
6767
/// <see cref="GetService"/> may be used to request it.
6868
/// </remarks>

src/Libraries/Microsoft.Extensions.AI.Abstractions/Embeddings/EmbeddingGenerationOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ public int? Dimensions
5555
/// </summary>
5656
/// <remarks>
5757
/// The underlying <see cref="IEmbeddingGenerator" /> implementation may have its own representation of options.
58-
/// When <see cref="IEmbeddingGenerator{TInput, TEmbedding}.GenerateAsync" />
58+
/// When <see cref="IEmbeddingGenerator{TInput, TEmbedding}.GenerateAsync" />
5959
/// is invoked with an <see cref="EmbeddingGenerationOptions" />, that implementation may convert the provided options into
6060
/// its own representation in order to use it while performing the operation. For situations where a consumer knows
6161
/// which concrete <see cref="IEmbeddingGenerator" /> is being used and how it represents options, a new instance of that
6262
/// implementation-specific options type may be returned by this callback, for the <see cref="IEmbeddingGenerator" />
6363
/// implementation to use instead of creating a new instance. Such implementations may mutate the supplied options
6464
/// instance further based on other settings supplied on this <see cref="EmbeddingGenerationOptions" /> instance or from other inputs,
6565
/// therefore, it is <b>strongly recommended</b> to not return shared instances and instead make the callback return a new instance on each call.
66-
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly-typed
66+
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly typed
6767
/// properties on <see cref="EmbeddingGenerationOptions" />.
6868
/// </remarks>
6969
[JsonIgnore]

src/Libraries/Microsoft.Extensions.AI.Abstractions/Functions/AIFunctionFactoryOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public AIFunctionFactoryOptions()
9090
/// <see langword="void"/>-returning methods).
9191
/// </para>
9292
/// <para>
93-
/// Methods strongly-typed to return types of <see cref="Task"/>, <see cref="Task{TResult}"/>, <see cref="ValueTask"/>,
93+
/// Methods strongly typed to return types of <see cref="Task"/>, <see cref="Task{TResult}"/>, <see cref="ValueTask"/>,
9494
/// and <see cref="ValueTask{TResult}"/> are special-cased. For methods typed to return <see cref="Task"/> or <see cref="ValueTask"/>,
9595
/// <see cref="MarshalResult"/> will be invoked with the <see langword="null"/> value after the returned task has successfully completed.
9696
/// For methods typed to return <see cref="Task{TResult}"/> or <see cref="ValueTask{TResult}"/>, the delegate will be invoked with the

src/Libraries/Microsoft.Extensions.AI.Abstractions/SpeechToText/SpeechToTextOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected SpeechToTextOptions(SpeechToTextOptions? other)
6060
/// implementation to use instead of creating a new instance. Such implementations may mutate the supplied options
6161
/// instance further based on other settings supplied on this <see cref="SpeechToTextOptions" /> instance or from other inputs,
6262
/// therefore, it is <b>strongly recommended</b> to not return shared instances and instead make the callback return a new instance on each call.
63-
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly-typed
63+
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly typed
6464
/// properties on <see cref="SpeechToTextOptions" />.
6565
/// </remarks>
6666
[JsonIgnore]

src/Libraries/Microsoft.Extensions.AI.Abstractions/Tools/AITool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected AITool()
3737
/// <returns>The found object, otherwise <see langword="null"/>.</returns>
3838
/// <exception cref="ArgumentNullException"><paramref name="serviceType"/> is <see langword="null"/>.</exception>
3939
/// <remarks>
40-
/// The purpose of this method is to allow for the retrieval of strongly-typed services that might be provided by the <see cref="AITool"/>,
40+
/// The purpose of this method is to allow for the retrieval of strongly typed services that might be provided by the <see cref="AITool"/>,
4141
/// including itself or any services it might be wrapping.
4242
/// </remarks>
4343
public virtual object? GetService(Type serviceType, object? serviceKey = null)

0 commit comments

Comments
 (0)