Share via


AIFunction.JsonSchema Property

Definition

Gets a JSON Schema describing the function and its input parameters.

public:
 virtual property System::Text::Json::JsonElement JsonSchema { System::Text::Json::JsonElement get(); };
public virtual System.Text.Json.JsonElement JsonSchema { get; }
member this.JsonSchema : System.Text.Json.JsonElement
Public Overridable ReadOnly Property JsonSchema As JsonElement

Property Value

Remarks

When specified, declares a self-contained JSON schema document that describes the function and its input parameters. A simple example of a JSON schema for a function that adds two numbers together is shown below:

{
  "title" : "addNumbers",
  "description": "A simple function that adds two numbers together.",
  "type": "object",
  "properties": {
    "a" : { "type": "number" },
    "b" : { "type": "number", "default": 1 }
  }, 
  "required" : ["a"]
}

The metadata present in the schema document plays an important role in guiding AI function invocation.

When no schema is specified, consuming chat clients should assume the "{}" or "true" schema, indicating that any JSON input is admissible.

Applies to