mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-04-15 03:01:37 +00:00
19 lines
591 B
C#
19 lines
591 B
C#
|
|
namespace AIStudio.Provider;
|
||
|
|
|
||
|
|
public sealed record ModelLoadResult(
|
||
|
|
IReadOnlyList<Model> Models,
|
||
|
|
ModelLoadFailureReason FailureReason = ModelLoadFailureReason.NONE,
|
||
|
|
string? TechnicalDetails = null)
|
||
|
|
{
|
||
|
|
public bool Success => this.FailureReason is ModelLoadFailureReason.NONE;
|
||
|
|
|
||
|
|
public static ModelLoadResult FromModels(IEnumerable<Model> models)
|
||
|
|
{
|
||
|
|
return new([..models]);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static ModelLoadResult Failure(ModelLoadFailureReason failureReason, string? technicalDetails = null)
|
||
|
|
{
|
||
|
|
return new([], failureReason, technicalDetails);
|
||
|
|
}
|
||
|
|
}
|