Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions _zip/missingapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ references:
name: ConversationFunctionTool
fullname: OpenAI.Realtime.ConversationFunctionTool
href: https://github.com/openai/openai-dotnet/blob/main/api/OpenAI.netstandard2.0.cs
- uid: OpenAI.Realtime.RealtimeClient
name: RealtimeClient
fullname: OpenAI.Realtime.RealtimeClient
href: https://github.com/openai/openai-dotnet/blob/main/api/OpenAI.netstandard2.0.cs
- uid: OpenAI.Realtime.RealtimeFunctionTool
name: RealtimeFunctionTool
fullname: OpenAI.Realtime.RealtimeFunctionTool
Expand Down
484 changes: 483 additions & 1 deletion xml/FrameworksIndex/net-10.0-pp.xml

Large diffs are not rendered by default.

484 changes: 483 additions & 1 deletion xml/FrameworksIndex/net-11.0-pp.xml

Large diffs are not rendered by default.

342 changes: 317 additions & 25 deletions xml/FrameworksIndex/net-11.0.xml

Large diffs are not rendered by default.

404 changes: 403 additions & 1 deletion xml/FrameworksIndex/net-8.0-pp.xml

Large diffs are not rendered by default.

404 changes: 403 additions & 1 deletion xml/FrameworksIndex/net-9.0-pp.xml

Large diffs are not rendered by default.

482 changes: 481 additions & 1 deletion xml/FrameworksIndex/netframework-4.6.2-pp.xml

Large diffs are not rendered by default.

482 changes: 481 additions & 1 deletion xml/FrameworksIndex/netframework-4.7-pp.xml

Large diffs are not rendered by default.

482 changes: 481 additions & 1 deletion xml/FrameworksIndex/netframework-4.7.1-pp.xml

Large diffs are not rendered by default.

482 changes: 481 additions & 1 deletion xml/FrameworksIndex/netframework-4.7.2-pp.xml

Large diffs are not rendered by default.

482 changes: 481 additions & 1 deletion xml/FrameworksIndex/netframework-4.8-pp.xml

Large diffs are not rendered by default.

482 changes: 481 additions & 1 deletion xml/FrameworksIndex/netframework-4.8.1-pp.xml

Large diffs are not rendered by default.

482 changes: 481 additions & 1 deletion xml/FrameworksIndex/netstandard-2.0-pp.xml

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions xml/Microsoft.Extensions.AI/AIFunctionDeclaration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
<para>
The metadata present in the schema document plays an important role in guiding AI function invocation.
</para>
<para>
When an <see cref="T:Microsoft.Extensions.AI.AIFunction" /> is created via <see cref="T:Microsoft.Extensions.AI.AIFunctionFactory" />, this schema is automatically derived from the
method's parameters using the configured <see cref="T:System.Text.Json.JsonSerializerOptions" /> and <see cref="T:Microsoft.Extensions.AI.AIJsonSchemaCreateOptions" />.
</para>
<para>
When no schema is specified, consuming chat clients should assume the "{}" or "true" schema, indicating that any JSON input is admissible.
</para>
Expand All @@ -107,9 +111,19 @@
<summary>Gets a JSON Schema describing the function's return value.</summary>
<value>To be added.</value>
<remarks>
A <see langword="null" /> typically reflects a function that doesn't specify a return schema
or a function that returns <see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />.
</remarks>
<para>
When an <see cref="T:Microsoft.Extensions.AI.AIFunction" /> is created via <see cref="T:Microsoft.Extensions.AI.AIFunctionFactory" />, this schema is automatically derived from the
method's return type using the configured <see cref="T:System.Text.Json.JsonSerializerOptions" /> and <see cref="T:Microsoft.Extensions.AI.AIJsonSchemaCreateOptions" />.
For methods returning <see cref="T:System.Threading.Tasks.Task`1" /> or <see cref="T:System.Threading.Tasks.ValueTask`1" />, the schema is based on the
unwrapped result type. Return schema generation can be excluded by setting
<see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.ExcludeResultSchema" /> to <see langword="true" />.
</para>
<para>
A <see langword="null" /> value typically reflects a function that doesn't specify a return schema,
a function that returns <see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />,
or a function for which <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.ExcludeResultSchema" /> was set to <see langword="true" />.
</para>
</remarks>
</Docs>
</Member>
</Members>
Expand Down
49 changes: 47 additions & 2 deletions xml/Microsoft.Extensions.AI/AIFunctionFactory.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@
</Attributes>
<Docs>
<summary>Provides factory methods for creating commonly-used implementations of <see cref="T:Microsoft.Extensions.AI.AIFunction" />.</summary>
<remarks>To be added.</remarks>
<remarks>
<para>
The <see cref="T:Microsoft.Extensions.AI.AIFunctionFactory" /> class creates <see cref="T:Microsoft.Extensions.AI.AIFunction" /> instances that wrap .NET methods
(specified as <see cref="T:System.Delegate" /> or <see cref="T:System.Reflection.MethodInfo" />). As part of this process, JSON schemas are
automatically derived for both the function's input parameters (exposed via <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.JsonSchema" />)
and, by default, the function's return type (exposed via <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" />).
These schemas are produced using the <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.SerializerOptions" /> and
<see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.JsonSchemaCreateOptions" />, and enable AI services to understand and
interact with the function. Return value serialization and schema derivation behavior can be customized
via <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.MarshalResult" /> and <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.ExcludeResultSchema" />,
respectively.
</para>
</remarks>
<related type="Article" href="https://learn.microsoft.com/dotnet/ai/quickstarts/use-function-calling">Invoke .NET functions using an AI model.</related>
</Docs>
<Members>
Expand Down Expand Up @@ -129,7 +141,14 @@
special-cased and are not serialized: the created function returns the original instance(s) directly to enable
callers (such as an <c>IChatClient</c>) to perform type tests and implement specialized handling. If
<see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.MarshalResult" /> is supplied, that delegate governs the behavior instead.
Handling of return values can be overridden via <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.MarshalResult" />.
</para>
<para>
In addition to the parameter schema, a JSON schema is also derived from the method's return type and exposed via the
returned <see cref="T:Microsoft.Extensions.AI.AIFunction" />'s <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" />. For methods returning
<see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />, no return schema is produced (the property is <see langword="null" />).
For methods returning <see cref="T:System.Threading.Tasks.Task`1" /> or <see cref="T:System.Threading.Tasks.ValueTask`1" />, the schema is derived from the
unwrapped result type. Return schema generation can be excluded via <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.ExcludeResultSchema" />,
and its generation is governed by <paramref name="options" />'s <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.JsonSchemaCreateOptions" />.
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
Expand Down Expand Up @@ -236,6 +255,14 @@
assignable from <see cref="T:System.Collections.Generic.IEnumerable`1" /> are returned directly without serialization.
Handling of return values can be overridden via <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.MarshalResult" />.
</para>
<para>
In addition to the parameter schema, a JSON schema is also derived from the method's return type and exposed via the
returned <see cref="T:Microsoft.Extensions.AI.AIFunction" />'s <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" />. For methods returning
<see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />, no return schema is produced (the property is <see langword="null" />).
For methods returning <see cref="T:System.Threading.Tasks.Task`1" /> or <see cref="T:System.Threading.Tasks.ValueTask`1" />, the schema is derived from the
unwrapped result type. Return schema generation can be excluded via <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.ExcludeResultSchema" />,
and its generation is governed by <paramref name="options" />'s <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.JsonSchemaCreateOptions" />.
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="createInstanceFunc" /> is <see langword="null" />.</exception>
Expand Down Expand Up @@ -345,6 +372,14 @@
any type assignable from <see cref="T:System.Collections.Generic.IEnumerable`1" /> are not serialized and are instead returned directly.
Handling of return values can be overridden via <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.MarshalResult" />.
</para>
<para>
In addition to the parameter schema, a JSON schema is also derived from the method's return type and exposed via the
returned <see cref="T:Microsoft.Extensions.AI.AIFunction" />'s <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" />. For methods returning
<see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />, no return schema is produced (the property is <see langword="null" />).
For methods returning <see cref="T:System.Threading.Tasks.Task`1" /> or <see cref="T:System.Threading.Tasks.ValueTask`1" />, the schema is derived from the
unwrapped result type. Return schema generation can be excluded via <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.ExcludeResultSchema" />,
and its generation is governed by <paramref name="options" />'s <see cref="P:Microsoft.Extensions.AI.AIFunctionFactoryOptions.JsonSchemaCreateOptions" />.
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="method" /> represents an instance method but <paramref name="target" /> is null.</exception>
Expand Down Expand Up @@ -445,6 +480,11 @@
derived type of <see cref="T:Microsoft.Extensions.AI.AIContent" />, or any type assignable from <see cref="T:System.Collections.Generic.IEnumerable`1" /> are not serialized;
they are returned as-is to facilitate specialized handling.
</para>
<para>
A JSON schema is also derived from the method's return type and exposed via <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" />.
For methods returning <see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />, no return schema is produced.
For methods returning <see cref="T:System.Threading.Tasks.Task`1" /> or <see cref="T:System.Threading.Tasks.ValueTask`1" />, the schema is derived from the unwrapped result type.
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="method" /> is <see langword="null" />.</exception>
Expand Down Expand Up @@ -551,6 +591,11 @@
derived type of <see cref="T:Microsoft.Extensions.AI.AIContent" />, or any type assignable from <see cref="T:System.Collections.Generic.IEnumerable`1" /> are returned
without serialization to enable specialized handling.
</para>
<para>
A JSON schema is also derived from the method's return type and exposed via <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" />.
For methods returning <see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />, no return schema is produced.
For methods returning <see cref="T:System.Threading.Tasks.Task`1" /> or <see cref="T:System.Threading.Tasks.ValueTask`1" />, the schema is derived from the unwrapped result type.
</para>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="method" /> represents an instance method but <paramref name="target" /> is null.</exception>
Expand Down
13 changes: 9 additions & 4 deletions xml/Microsoft.Extensions.AI/AIFunctionFactoryOptions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,17 @@
</ReturnValue>
<Docs>
<summary>
Gets or sets a value indicating whether a schema should be created for the function's result type, if possible, and included as <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" />.
Gets or sets a value indicating whether to exclude generation of a JSON schema for the function's return type.
</summary>
<value>To be added.</value>
<remarks>
<para>
The default value is <see langword="false" />.
The default value is <see langword="false" />, meaning a return type schema will be generated and exposed
via <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" /> when the method has a return type other than
<see cref="T:System.Void" />, <see cref="T:System.Threading.Tasks.Task" />, or <see cref="T:System.Threading.Tasks.ValueTask" />.
</para>
<para>
When set to <see langword="true" />, results in the produced <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" /> to always be <see langword="null" />.
When set to <see langword="true" />, the produced <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" /> will always be <see langword="null" />.
</para>
</remarks>
</Docs>
Expand All @@ -220,11 +222,14 @@
</ReturnValue>
<Docs>
<summary>
Gets or sets the <see cref="T:Microsoft.Extensions.AI.AIJsonSchemaCreateOptions" /> governing the generation of JSON schemas for the function.
Gets or sets the <see cref="T:Microsoft.Extensions.AI.AIJsonSchemaCreateOptions" /> governing the generation of JSON schemas for
the function's input parameters and return type.
</summary>
<value>To be added.</value>
<remarks>
If no value has been specified, the <see cref="P:Microsoft.Extensions.AI.AIJsonSchemaCreateOptions.Default" /> instance will be used.
This setting affects both the <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.JsonSchema" /> (input parameters) and
the <see cref="P:Microsoft.Extensions.AI.AIFunctionDeclaration.ReturnJsonSchema" /> (return type).
</remarks>
</Docs>
</Member>
Expand Down
Loading
Loading