semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

New Feature: Add metadata to the constructor of BinaryContent

Open aeras3637 opened this issue 2 years ago • 1 comments

Can you please make it possible to add metadata in the constructors of BinaryContent, ImageContent, and AudioContent? I want to record the file name and file size when registering an image to ImageContent.

aeras3637 avatar Sep 12 '24 06:09 aeras3637

@aeras3637 you can use the following pattern:

var content = new BinaryContent
{
    Metadata = new Dictionary<string, object?>
    {
        { "key1", "value1" },
        { "key2", "value2" }
    }
};

markwallace-microsoft avatar Sep 12 '24 14:09 markwallace-microsoft