AIFunctionDeclaration.ReturnJsonSchema Property
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.
Gets a JSON Schema describing the function's return value.
public:
virtual property Nullable<System::Text::Json::JsonElement> ReturnJsonSchema { Nullable<System::Text::Json::JsonElement> get(); };
public virtual System.Text.Json.JsonElement? ReturnJsonSchema { get; }
member this.ReturnJsonSchema : Nullable<System.Text.Json.JsonElement>
Public Overridable ReadOnly Property ReturnJsonSchema As Nullable(Of JsonElement)
Property Value
Remarks
When an AIFunction is created via AIFunctionFactory, this schema is automatically derived from the method's return type using the configured JsonSerializerOptions and AIJsonSchemaCreateOptions. For methods returning Task<TResult> or ValueTask<TResult>, the schema is based on the unwrapped result type. Return schema generation can be excluded by setting ExcludeResultSchema to true.
A null value typically reflects a function that doesn't specify a return schema, a function that returns Void, Task, or ValueTask, or a function for which ExcludeResultSchema was set to true.