Add custom metadata to ChatMessageContent like DateTimeCreated message was generated #9996
-
What is the recommended way to add custom information to either the user or ai generated response like datetime created to show the actual time the message was logged in the chat history. This could also apply to any other custom metadata you may want to save
|
Beta Was this translation helpful? Give feedback.
Answered by
markwallace-microsoft
Jan 7, 2025
Replies: 2 comments
-
Tagging @markwallace-microsoft to reply once he returns from vacation. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@giannik You can use the metadata dictionary to store additional data _chatHistory.Add(new ChatMessageContent() { Content = input,
Role = ChatMessageRole.User
Metadata = <IReadOnlyDictionary containing your metadata>
});; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sophialagerkranspandey
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@giannik You can use the metadata dictionary to store additional data