using System.Linq;
using xAiModels.Configurations;
using xAiModels.Models;
using xCommons.Extensions;
namespace xAiModels.Extensions
{
public static class XAiApiConfigurationExtensions
{
///
/// Validate Api Configuration ...
///
///
///
public static bool IsValid(this XAiApiConfiguration source)
{
return
!source.IsNullOrDefault() &&
source.Models.HasChild();
}
///
/// Retrieve Default Model Descriptor ...
///
///
///
public static XAiModelDescriptor GetDefaultModel(this XAiApiConfiguration source)
{
//
XAiModelDescriptor result = null;
//
if (source.IsValid())
{
result = source.Models.First();
}
//
return result;
}
}
}