You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AddAIContentType automatically registers the content type against every base in the inheritance chain up to AIContent (#7358)
* Initial plan
* Make AddAIContentType with baseType parameter public
Add two new public overloads of AddAIContentType that accept a baseType
parameter, allowing consumers to register AIContent-derived types in
custom polymorphic hierarchies (e.g., under ToolCallContent or
ToolResultContent, not just AIContent).
- Generic: AddAIContentType<TContent>(options, baseType, discriminatorId)
- Non-generic: AddAIContentType(options, baseType, contentType, discriminatorId)
Updates API baseline and adds comprehensive unit tests.
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
* Auto-register AddAIContentType across full inheritance chain
Instead of adding new baseType overloads, modify the existing
AddAIContentType methods to automatically walk the inheritance
chain from the content type up to AIContent, registering against
every intermediate base type. This eliminates the need for callers
to manually register against each level in the hierarchy.
The internal registration of experimental types (CodeInterpreter,
ImageGeneration) is simplified from 8 calls to 4, since the chain
walker handles intermediate bases (ToolCallContent/ToolResultContent)
automatically.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Add CHANGELOG entry for AddAIContentType chain registration
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Augment tests
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Co-authored-by: David Cantu <dacantu@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@@ -46,7 +46,7 @@ public static void AddAIContentType<TContent>(this JsonSerializerOptions options
46
46
/// <param name="contentType">The custom content type to configure.</param>
47
47
/// <param name="typeDiscriminatorId">The type discriminator id for the content type.</param>
48
48
/// <exception cref="ArgumentNullException"><paramref name="options"/>, <paramref name="contentType"/>, or <paramref name="typeDiscriminatorId"/> is <see langword="null"/>.</exception>
49
-
/// <exception cref="ArgumentException"><paramref name="contentType"/> is a built-in content type or does not derived from <see cref="AIContent"/>.</exception>
49
+
/// <exception cref="ArgumentException"><paramref name="contentType"/> is a built-in content type or does not derive from <see cref="AIContent"/>.</exception>
50
50
/// <exception cref="InvalidOperationException"><paramref name="options"/> is a read-only instance.</exception>
0 commit comments