Skip to content
Discussion options

You must be logged in to vote

Does the framework generate a JSON schema for the return type

Yes, e.g. this:

using System.ComponentModel;
using Microsoft.Extensions.AI;

AIFunction f = AIFunctionFactory.Create(() => new TransactionResult());
Console.WriteLine(f.ReturnJsonSchema);

[Description("Description of the result object in general")] 
class TransactionResult
{
    [Description("Description of individual properties")]
    public string TransactionCode { get; set; }
}

outputs this:

{"description":"Description of the result object in general","type":"object","properties":{"transactionCode":{"description":"Description of individual properties","type":"string"}}}

Is this schema included in the tool definition sent…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@major-mayer
Comment options

Answer selected by major-mayer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants