forked from SciSharp/BotSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConversationViewModel.cs
More file actions
32 lines (29 loc) · 930 Bytes
/
ConversationViewModel.cs
File metadata and controls
32 lines (29 loc) · 930 Bytes
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
using BotSharp.Abstraction.Conversations.Dtos;
using System.Text.Json.Serialization;
namespace BotSharp.OpenAPI.ViewModels.Conversations;
public class ConversationViewModel : ConversationDto
{
[JsonPropertyName("is_realtime_enabled")]
public bool IsRealtimeEnabled { get; set; }
public static ConversationViewModel FromSession(Conversation sess)
{
return new ConversationViewModel
{
Id = sess.Id,
User = new()
{
Id = sess.UserId
},
AgentId = sess.AgentId,
Title = sess.Title,
TitleAlias = sess.TitleAlias,
Channel = sess.Channel,
Status = sess.Status,
TaskId = sess.TaskId,
Tags = sess.Tags ?? [],
States = sess.States ?? [],
CreatedTime = sess.CreatedTime,
UpdatedTime = sess.UpdatedTime
};
}
}