This commit is contained in:
2026-04-24 00:33:50 +03:30
parent 8786470134
commit 5efd41754a
46 changed files with 1104 additions and 4 deletions
+71 -4
View File
@@ -1,12 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations.Schema;
using xModels.Base;
using xCommons.Extensions;
using xAiModels.Constants;
namespace xAiApi.AI.Models.Entities
{
public class XAiMessage
/// <summary>
/// Message Model of Ai ...
/// </summary>
public class XAiMessage : XBaseGuidIDEntity
{
/// <summary>
/// Message of Chat ...
/// </summary>
public string Content { get; set; }
/// <summary>
/// Role of Message ...
/// </summary>
public XAiChatRole Role { get; set; }
/// <summary>
/// Created Time ...
/// </summary>
public DateTime CreatedOn { get; set; }
/// <summary>
/// Updated Time ...
/// </summary>
public DateTime UpdatedAt { get; set; }
/// <summary>
/// Conversation Id ...
/// </summary>
public Guid ConversationId { get; set; }
/// <summary>
/// Conversation ...
/// </summary>
public XAiConversation Conversation { get; set; }
//
#region Meta Data Property ...
private string _metadata;
/// <summary>
/// Meta Data of Message ...
/// </summary>
[NotMapped]
public IDictionary<string, object> Metadata { get; private set; } = null;
/// <summary>
/// Meta Data of MEssage in Json ...
/// </summary>
public string MeatDatas
{
//
get => _metadata;
//
set
{
//
// Converts Json String to Dictionary ...
if (!value.IsNullOrEmpty())
{
Metadata = value.FromJSON<IDictionary<string, object>>();
}
//
_metadata = value;
}
}
#endregion
}
}