Skip to content

Commit

Permalink
.Net The 'Source' property added to the ChatMessageContent class (#5091)
Browse files Browse the repository at this point in the history
### Motivation and Context  
For agent customization story, when converting or translating messages
from one agent to another, we need a way to access the agent that
generated the messages.
   
### Description  
This PR adds the 'Source' property to the ChatMessageContent class.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
  • Loading branch information
SergeyMenshykh committed Feb 26, 2024
1 parent f40ea59 commit 5288bcb
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Text.Json.Serialization;
using Microsoft.SemanticKernel.ChatCompletion;
Expand Down Expand Up @@ -33,6 +34,17 @@ public class ChatMessageContent : KernelContent
[JsonIgnore]
public Encoding Encoding { get; set; }

/// <summary>
/// Represents the source of the message.
/// </summary>
/// <remarks>
/// The source is corresponds to the entity that generated this message.
/// The property is intended to be used by agents to associate themselves with the messages they generate.
/// </remarks>
[Experimental("SKEXP0101")]
[JsonIgnore]
public object? Source { get; set; }

/// <summary>
/// Creates a new instance of the <see cref="ChatMessageContent"/> class
/// </summary>
Expand Down

0 comments on commit 5288bcb

Please sign in to comment.