Skip to content

Commit 902b6f7

Browse files
Doc improvements (#6794)
* doc improvements * Apply suggestions from code review --------- Co-authored-by: Stephen Toub <[email protected]>
1 parent c7675ae commit 902b6f7

File tree

13 files changed

+94
-93
lines changed

13 files changed

+94
-93
lines changed

src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/CitationAnnotation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public CitationAnnotation()
2222
/// Gets or sets the title or name of the source.
2323
/// </summary>
2424
/// <remarks>
25-
/// This could be the title of a document, a title from a web page, a name of a file, or similarly descriptive text.
25+
/// This value could be the title of a document, the title from a web page, the name of a file, or similarly descriptive text.
2626
/// </remarks>
2727
public string? Title { get; set; }
2828

@@ -34,7 +34,7 @@ public CitationAnnotation()
3434
/// <summary>Gets or sets a source identifier associated with the annotation.</summary>
3535
/// <remarks>
3636
/// This is a provider-specific identifier that can be used to reference the source material by
37-
/// an ID. This may be a document ID, or a file ID, or some other identifier for the source material
37+
/// an ID. This might be a document ID, a file ID, or some other identifier for the source material
3838
/// that can be used to uniquely identify it with the provider.
3939
/// </remarks>
4040
public string? FileId { get; set; }

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ namespace Microsoft.Extensions.AI;
1111
/// <summary>Represents a function that can be described to an AI service.</summary>
1212
/// <remarks>
1313
/// <see cref="AIFunctionDeclaration"/> is the base class for <see cref="AIFunction"/>, which
14-
/// adds the ability to invoke the function. Components may type test <see cref="AITool"/> instances
14+
/// adds the ability to invoke the function. Components can type test <see cref="AITool"/> instances
1515
/// for <see cref="AIFunctionDeclaration"/> to determine whether they can be described as functions,
16-
/// and may type test for <see cref="AIFunction"/> to determine whether they can be invoked.
16+
/// and can type test for <see cref="AIFunction"/> to determine whether they can be invoked.
1717
/// </remarks>
1818
public abstract class AIFunctionDeclaration : AITool
1919
{
@@ -36,7 +36,7 @@ protected AIFunctionDeclaration()
3636
/// "properties": {
3737
/// "a" : { "type": "number" },
3838
/// "b" : { "type": "number", "default": 1 }
39-
/// },
39+
/// },
4040
/// "required" : ["a"]
4141
/// }
4242
/// </code>

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

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

src/Libraries/Microsoft.Extensions.AI.Abstractions/HostedMcpServerToolApprovalMode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ private protected HostedMcpServerToolApprovalMode()
4040
/// <summary>
4141
/// Instantiates a <see cref="HostedMcpServerToolApprovalMode"/> that specifies approval behavior for individual tool names.
4242
/// </summary>
43-
/// <param name="alwaysRequireApprovalToolNames">The list of tools names that always require approval.</param>
44-
/// <param name="neverRequireApprovalToolNames">The list of tools names that never require approval.</param>
43+
/// <param name="alwaysRequireApprovalToolNames">The list of tool names that always require approval.</param>
44+
/// <param name="neverRequireApprovalToolNames">The list of tool names that never require approval.</param>
4545
/// <returns>An instance of <see cref="HostedMcpServerToolRequireSpecificApprovalMode"/> for the specified tool names.</returns>
4646
public static HostedMcpServerToolRequireSpecificApprovalMode RequireSpecific(IList<string>? alwaysRequireApprovalToolNames, IList<string>? neverRequireApprovalToolNames)
4747
=> new(alwaysRequireApprovalToolNames, neverRequireApprovalToolNames);

src/Libraries/Microsoft.Extensions.AI.Abstractions/Image/ImageGenerationOptions.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class ImageGenerationOptions
2121
/// Gets or sets the size of the generated image.
2222
/// </summary>
2323
/// <remarks>
24-
/// If a provider only supports fixed sizes the closest supported size will be used.
24+
/// If a provider only supports fixed sizes, the closest supported size is used.
2525
/// </remarks>
2626
public Size? ImageSize { get; set; }
2727

@@ -39,16 +39,16 @@ public class ImageGenerationOptions
3939
/// Gets or sets a callback responsible for creating the raw representation of the image generation options from an underlying implementation.
4040
/// </summary>
4141
/// <remarks>
42-
/// The underlying <see cref="IImageGenerator" /> implementation may have its own representation of options.
42+
/// The underlying <see cref="IImageGenerator" /> implementation can have its own representation of options.
4343
/// When <see cref="IImageGenerator.GenerateAsync" /> is invoked with an <see cref="ImageGenerationOptions" />,
44-
/// that implementation may convert the provided options into its own representation in order to use it while performing
44+
/// that implementation can convert the provided options into its own representation in order to use it while performing
4545
/// the operation. For situations where a consumer knows which concrete <see cref="IImageGenerator" /> is being used
46-
/// and how it represents options, a new instance of that implementation-specific options type may be returned by this
47-
/// callback, for the <see cref="IImageGenerator" />implementation to use instead of creating a new instance.
48-
/// Such implementations may mutate the supplied options instance further based on other settings supplied on this
46+
/// and how it represents options, a new instance of that implementation-specific options type can be returned by this
47+
/// callback for the <see cref="IImageGenerator" /> implementation to use instead of creating a new instance.
48+
/// Such implementations might mutate the supplied options instance further based on other settings supplied on this
4949
/// <see cref="ImageGenerationOptions" /> instance or from other inputs, therefore, it is <b>strongly recommended</b> to not
5050
/// return shared instances and instead make the callback return a new instance on each call.
51-
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly-typed
51+
/// This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly typed
5252
/// properties on <see cref="ImageGenerationOptions" />.
5353
/// </remarks>
5454
[JsonIgnore]
@@ -81,7 +81,7 @@ public virtual ImageGenerationOptions Clone()
8181
/// Represents the requested response format of the generated image.
8282
/// </summary>
8383
/// <remarks>
84-
/// Not all implementations support all response formats and this value may be ignored by the implementation if not supported.
84+
/// Not all implementations support all response formats and this value might be ignored by the implementation if not supported.
8585
/// </remarks>
8686
[Experimental("MEAI001")]
8787
public enum ImageGenerationResponseFormat

src/Libraries/Microsoft.Extensions.AI.Abstractions/Image/ImageGenerationResponse.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ public ImageGenerationResponse(IList<AIContent>? contents)
3939
public object? RawRepresentation { get; set; }
4040

4141
/// <summary>
42-
/// Gets or sets the generated content items. Content will typically be DataContent for
43-
/// images streamed from the generator or UriContent for remotely hosted images, but may also
44-
/// be provider specific content types that represent the generated images.
42+
/// Gets or sets the generated content items.
4543
/// </summary>
44+
/// <remarks>
45+
/// Content is typically <see cref="DataContent"/> for images streamed from the generator, or <see cref="UriContent"/> for remotely hosted images, but
46+
/// can also be provider-specific content types that represent the generated images.
47+
/// </remarks>
4648
[AllowNull]
4749
public IList<AIContent> Contents
4850
{

src/Libraries/Microsoft.Extensions.AI.Abstractions/Image/ImageGeneratorExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Microsoft.Extensions.AI;
1313

14-
/// <summary>Extensions for <see cref="IImageGenerator"/>.</summary>
14+
/// <summary>Provides extension methods for <see cref="IImageGenerator"/>.</summary>
1515
[Experimental("MEAI001")]
1616
public static class ImageGeneratorExtensions
1717
{
@@ -102,7 +102,7 @@ public static TService GetRequiredService<TService>(this IImageGenerator generat
102102
/// <param name="prompt">The prompt to guide the image generation.</param>
103103
/// <param name="options">The image generation options to configure the request.</param>
104104
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
105-
/// <exception cref="ArgumentNullException"><paramref name="generator"/> or <paramref name="prompt"/> are <see langword="null"/>.</exception>
105+
/// <exception cref="ArgumentNullException"><paramref name="generator"/> or <paramref name="prompt"/> is <see langword="null"/>.</exception>
106106
/// <returns>The images generated by the generator.</returns>
107107
public static Task<ImageGenerationResponse> GenerateImagesAsync(
108108
this IImageGenerator generator,
@@ -124,7 +124,7 @@ public static Task<ImageGenerationResponse> GenerateImagesAsync(
124124
/// <param name="prompt">The prompt to guide the image editing.</param>
125125
/// <param name="options">The image generation options to configure the request.</param>
126126
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
127-
/// <exception cref="ArgumentNullException"><paramref name="generator"/>, <paramref name="originalImages"/>, or <paramref name="prompt"/> are <see langword="null"/>.</exception>
127+
/// <exception cref="ArgumentNullException"><paramref name="generator"/>, <paramref name="originalImages"/>, or <paramref name="prompt"/> is <see langword="null"/>.</exception>
128128
/// <returns>The images generated by the generator.</returns>
129129
public static Task<ImageGenerationResponse> EditImagesAsync(
130130
this IImageGenerator generator,
@@ -148,7 +148,7 @@ public static Task<ImageGenerationResponse> EditImagesAsync(
148148
/// <param name="prompt">The prompt to guide the image generation.</param>
149149
/// <param name="options">The image generation options to configure the request.</param>
150150
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
151-
/// <exception cref="ArgumentNullException"><paramref name="generator"/>, <paramref name="originalImage"/>, or <paramref name="prompt"/> are <see langword="null"/>.</exception>
151+
/// <exception cref="ArgumentNullException"><paramref name="generator"/>, <paramref name="originalImage"/>, or <paramref name="prompt"/> is <see langword="null"/>.</exception>
152152
/// <returns>The images generated by the generator.</returns>
153153
public static Task<ImageGenerationResponse> EditImageAsync(
154154
this IImageGenerator generator,
@@ -174,7 +174,7 @@ public static Task<ImageGenerationResponse> EditImageAsync(
174174
/// <param name="options">The image generation options to configure the request.</param>
175175
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
176176
/// <exception cref="ArgumentNullException">
177-
/// <paramref name="generator"/>, <paramref name="fileName"/>, or <paramref name="prompt"/> are <see langword="null"/>.
177+
/// <paramref name="generator"/>, <paramref name="fileName"/>, or <paramref name="prompt"/> is <see langword="null"/>.
178178
/// </exception>
179179
/// <returns>The images generated by the generator.</returns>
180180
public static Task<ImageGenerationResponse> EditImageAsync(

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public HostedFileSearchTool()
1919

2020
/// <summary>Gets or sets a collection of <see cref="AIContent"/> to be used as input to the file search tool.</summary>
2121
/// <remarks>
22-
/// If no explicit inputs are provided, the service will determine what inputs should be searched. Different services
23-
/// support different kinds of inputs, e.g. some may respect <see cref="HostedFileContent"/> using provider-specific file IDs,
24-
/// others may support binary data uploaded as part of the request in <see cref="DataContent"/>, while others may support
22+
/// If no explicit inputs are provided, the service determines what inputs should be searched. Different services
23+
/// support different kinds of inputs, for example, some might respect <see cref="HostedFileContent"/> using provider-specific file IDs,
24+
/// others might support binary data uploaded as part of the request in <see cref="DataContent"/>, and others might support
2525
/// content in a hosted vector store and represented by a <see cref="HostedVectorStoreContent"/>.
2626
/// </remarks>
2727
public IList<AIContent>? Inputs { get; set; }

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ public HostedMcpServerTool(string serverName, Uri url)
6767
/// </summary>
6868
/// <remarks>
6969
/// <para>
70-
/// You can set this property to <see cref="HostedMcpServerToolApprovalMode.AlwaysRequire"/> to require approval for all tool calls,
70+
/// You can set this property to <see cref="HostedMcpServerToolApprovalMode.AlwaysRequire"/> to require approval for all tool calls,
7171
/// or to <see cref="HostedMcpServerToolApprovalMode.NeverRequire"/> to never require approval.
7272
/// </para>
7373
/// <para>
74-
/// The default value is <see langword="null"/>, which some providers may treat the same as <see cref="HostedMcpServerToolApprovalMode.AlwaysRequire"/>.
74+
/// The default value is <see langword="null"/>, which some providers might treat the same as <see cref="HostedMcpServerToolApprovalMode.AlwaysRequire"/>.
7575
/// </para>
7676
/// <para>
7777
/// The underlying provider is not guaranteed to support or honor the approval mode.

src/Libraries/Microsoft.Extensions.AI.Abstractions/Utilities/AIJsonSchemaTransformCache.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Microsoft.Extensions.AI;
1919
/// implementations that enforce vendor-specific restrictions on what constitutes a valid JSON schema for a given function or response format.
2020
/// </para>
2121
/// <para>
22-
/// It is recommended <see cref="IChatClient"/> implementations with schema transformation requirements should create a single static instance of this cache.
22+
/// It is recommended <see cref="IChatClient"/> implementations with schema transformation requirements create a single static instance of this cache.
2323
/// </para>
2424
/// </remarks>
2525
public sealed class AIJsonSchemaTransformCache
@@ -56,7 +56,7 @@ public AIJsonSchemaTransformCache(AIJsonSchemaTransformOptions transformOptions)
5656
/// <summary>
5757
/// Gets or creates a transformed JSON schema for the specified <see cref="AIFunction"/> instance.
5858
/// </summary>
59-
/// <param name="function">The function whose JSON schema we want to transform.</param>
59+
/// <param name="function">The function whose JSON schema is to be transformed.</param>
6060
/// <returns>The transformed JSON schema corresponding to <see cref="TransformOptions"/>.</returns>
6161
[EditorBrowsable(EditorBrowsableState.Never)] // maintained for binary compat; functionality for AIFunction is satisfied by AIFunctionDeclaration overload
6262
public JsonElement GetOrCreateTransformedSchema(AIFunction function) =>
@@ -65,7 +65,7 @@ public JsonElement GetOrCreateTransformedSchema(AIFunction function) =>
6565
/// <summary>
6666
/// Gets or creates a transformed JSON schema for the specified <see cref="AIFunctionDeclaration"/> instance.
6767
/// </summary>
68-
/// <param name="function">The function whose JSON schema we want to transform.</param>
68+
/// <param name="function">The function whose JSON schema is to be transformed.</param>
6969
/// <returns>The transformed JSON schema corresponding to <see cref="TransformOptions"/>.</returns>
7070
public JsonElement GetOrCreateTransformedSchema(AIFunctionDeclaration function)
7171
{
@@ -76,7 +76,7 @@ public JsonElement GetOrCreateTransformedSchema(AIFunctionDeclaration function)
7676
/// <summary>
7777
/// Gets or creates a transformed JSON schema for the specified <see cref="ChatResponseFormatJson"/> instance.
7878
/// </summary>
79-
/// <param name="responseFormat">The response format whose JSON schema we want to transform.</param>
79+
/// <param name="responseFormat">The response format whose JSON schema is to be transformed.</param>
8080
/// <returns>The transformed JSON schema corresponding to <see cref="TransformOptions"/>.</returns>
8181
public JsonElement? GetOrCreateTransformedSchema(ChatResponseFormatJson responseFormat)
8282
{

0 commit comments

Comments
 (0)