64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using Microsoft.Extensions.AI;
|
|
using xAiModels.Models;
|
|
using xCommons.Extensions;
|
|
using xModels.Base;
|
|
|
|
namespace xAiApi.AI.Models.Dtos
|
|
{
|
|
public class XAiRequirementDto : XBaseDto
|
|
{
|
|
/// <summary>
|
|
/// Prepared Ai Project ...
|
|
/// if Exists one Using Project ID,
|
|
/// if not Created Default Project ...
|
|
/// </summary>
|
|
public XAiProjectDto AiProject { get; set; }
|
|
|
|
/// <summary>
|
|
/// Prepared Ai Conversation ...
|
|
/// if Exists one Using Conversation ID,
|
|
/// if not Created new Conversation ...
|
|
/// </summary>
|
|
public XAiConversationDto AiConversation { get; set; }
|
|
|
|
/// <summary>
|
|
/// Prepared Chat History for Asking ...
|
|
/// including Asked Prompt ...
|
|
/// </summary>
|
|
public IList<ChatMessage> ChatHistory { get; set; } = new List<ChatMessage>();
|
|
|
|
/// <summary>
|
|
/// Check User has Permission on
|
|
/// Project, Conversation and LLM Usages also ...
|
|
/// </summary>
|
|
public bool HasPermission { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Check Ai Project is Default Project of Specified User or not ...
|
|
/// Default Project is Main Conversations Contains ...
|
|
/// </summary>
|
|
public bool IsDefaultProject { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Check Ai Conversations is New Conversation or not ...
|
|
/// </summary>
|
|
public bool IsFirstConversation { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Check Model is Validate or not ...
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool IsValid()
|
|
{
|
|
//
|
|
var result =
|
|
HasPermission &&
|
|
!AiProject.IsNullOrDefault() &&
|
|
!AiConversation.IsNullOrDefault();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
}
|
|
} |