using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using xModels.Base;
using xCommons.Extensions;
using xAiModels.Constants;
namespace xAiApi.AI.Models.Entities
{
///
/// Message Model of Ai ...
///
public class XAiMessage : XBaseGuidIDEntity
{
///
/// Message of Chat ...
///
public string Content { get; set; }
///
/// Role of Message ...
///
public XAiChatRole Role { get; set; }
///
/// Created Time ...
///
public DateTime CreatedOn { get; set; }
///
/// Updated Time ...
///
public DateTime UpdatedAt { get; set; }
///
/// Conversation Id ...
///
public Guid ConversationId { get; set; }
///
/// Conversation ...
///
public XAiConversation Conversation { get; set; }
//
#region Meta Data Property ...
private string _metadata;
///
/// Meta Data of Message ...
///
[NotMapped]
public IDictionary Metadata { get; private set; } = null;
///
/// Meta Data of MEssage in Json ...
///
public string MeatDatas
{
//
get => _metadata;
//
set
{
//
// Converts Json String to Dictionary ...
if (!value.IsNullOrEmpty())
{
Metadata = value.FromJSON>();
}
//
_metadata = value;
}
}
#endregion
}
}