AIFunctionDeclaration.JsonSchema 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取描述函数及其输入参数的 JSON 架构。
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
属性值
注解
指定后,声明描述函数及其输入参数的自包含 JSON 架构文档。 下面显示了将两个数字相加的函数的 JSON 架构的简单示例:
{
"type": "object",
"properties": {
"a" : { "type": "number" },
"b" : { "type": ["number","null"], "default": 1 }
},
"required" : ["a"]
}
架构文档中存在的元数据在引导 AI 函数调用方面发挥了重要作用。
通过 创建一AIFunctionFactory个AIFunction架构时,此架构会自动派生自使用配置的JsonSerializerOptions和AIJsonSchemaCreateOptions方法的参数。
如果未指定任何架构,则使用聊天客户端应假定“{}”或“true”架构,指示任何 JSON 输入都允许。