Skip to content

.Net: Add support for descriptions in nested parameters #5757

@markwallace-microsoft

Description

@markwallace-microsoft

When using complex types as Kernel Function parameters, nested properties do not include their metadata (i.e. Descriptions) when being sent to OpenAI.

A completely made up example:

class LightPlugin
{
    [KernelFunction("ChangeState")]
    [Description("Changes the state of the light.'")]
    public string ChangeState(LightState state)
    {
    }
}


class LightState {
    [Description("Whether the light is on or off")]
    public bool BinaryState { get; set; }


    [Description("The brightness level of the light (0 - 100)")]
    public int Brightness { get; set; }

    [Description("The color of the light")]
    public int Color { get; set; }
}

The descriptions of the properties in LightState, will not be sent in the request to OpenAI.

Additionally, what would be the way to indicate if some of the nested properties are required as well.

Metadata

Metadata

Labels

.NETIssue or Pull requests regarding .NET codesk team issueA tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)

Type

No type

Projects

Status

Sprint: Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions