-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathChatHistoryMessage.cs
More file actions
56 lines (49 loc) · 1.9 KB
/
Copy pathChatHistoryMessage.cs
File metadata and controls
56 lines (49 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------------
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
namespace Microsoft.Agents.A365.Tooling.Models;
/// <summary>
/// Represents a single message in the chat history.
/// </summary>
public class ChatHistoryMessage
{
/// <summary>
/// Initializes a new instance of the <see cref="ChatHistoryMessage"/> class.
/// </summary>
/// <param name="id">The unique identifier for the chat message.</param>
/// <param name="role">The role of the message sender (e.g., "user", "system").</param>
/// <param name="content">The content of the chat message.</param>
/// <param name="timestamp">The timestamp of when the message was sent.</param>
public ChatHistoryMessage(string id, string role, string content, DateTimeOffset timestamp)
{
this.Id = id;
this.Role = role;
this.Content = content;
this.Timestamp = timestamp;
}
/// <summary>
/// Gets or sets the unique identifier for the chat message.
/// </summary>
[JsonPropertyName("id")]
[Required]
public string Id { get; set; }
/// <summary>
/// Gets or sets the role of the message sender (e.g., "user", "system").
/// </summary>
[JsonPropertyName("role")]
public string Role { get; set; }
/// <summary>
/// Gets or sets the content of the chat message.
/// </summary>
[JsonPropertyName("content")]
[Required]
public string Content { get; set; }
/// <summary>
/// Gets or sets the timestamp of when the message was sent.
/// </summary>
[JsonPropertyName("timestamp")]
[Required]
public DateTimeOffset Timestamp { get; set; }
}