diff --git a/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.RemoveById.cs b/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.RemoveById.cs index 5cae1f20..c8e3f708 100644 --- a/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.RemoveById.cs +++ b/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.RemoveById.cs @@ -24,7 +24,7 @@ private async Task ShouldThrowValidationExceptionOnRemoveByIdIfIdIsInvalidAsync( string invalidFileId = invalidId; var invalidFileException = - new InvalidAIFileException(); + new InvalidAIFileException(message: "Invalid AI file error occurred, fix errors and try again."); invalidFileException.AddData( key: nameof(AIFile.Response.Id), diff --git a/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.Upload.cs b/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.Upload.cs index d3d570f8..e6cf6792 100644 --- a/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.Upload.cs +++ b/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIFiles/AIFileServiceTests.Validations.Upload.cs @@ -19,7 +19,7 @@ private async Task ShouldThrowValidationExceptionOnUploadIfAIFileIsNull() { // given AIFile nullAIFile = null; - var nullAIFileException = new NullAIFileException(); + var nullAIFileException = new NullAIFileException(message: "Ai file is null."); var expectedAIFileValidationException = new AIFileValidationException( @@ -52,7 +52,7 @@ private async Task ShouldThrowValidationExceptionOnUploadIfAIFileRequestIsNull() invalidAIFile.Request = null; var invalidAIFileException = - new InvalidAIFileException(); + new InvalidAIFileException(message: "Invalid AI file error occurred, fix errors and try again."); invalidAIFileException.AddData( key: nameof(AIFile.Request), @@ -99,7 +99,7 @@ private async Task ShouldThrowValidationExceptionOnUploadIfAIFileRequestIsInvali }; var invalidAIFileException = - new InvalidAIFileException(); + new InvalidAIFileException(message: "Invalid AI file error occurred, fix errors and try again."); invalidAIFileException.AddData( key: nameof(AIFileRequest.Name), diff --git a/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIModels/AIModelServiceTests.Validations.RetrieveByName.cs b/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIModels/AIModelServiceTests.Validations.RetrieveByName.cs index 2232ec3e..9b736336 100644 --- a/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIModels/AIModelServiceTests.Validations.RetrieveByName.cs +++ b/Standard.AI.OpenAI.Tests.Unit/Services/Foundations/AIModels/AIModelServiceTests.Validations.RetrieveByName.cs @@ -22,7 +22,7 @@ private async Task ShouldThrowValidationExceptionOnRetrieveModelByNameIfModelNam { // given var invalidAIModelException = - new InvalidAIModelException(); + new InvalidAIModelException(message: "AI Model is invalid."); invalidAIModelException.AddData( key: nameof(AIModel.Name), diff --git a/Standard.AI.OpenAI.Tests.Unit/Services/Orchestrations/AIFiles/AIFileOrchestrationServiceTests.cs b/Standard.AI.OpenAI.Tests.Unit/Services/Orchestrations/AIFiles/AIFileOrchestrationServiceTests.cs index cebfc9b8..9ff852a1 100644 --- a/Standard.AI.OpenAI.Tests.Unit/Services/Orchestrations/AIFiles/AIFileOrchestrationServiceTests.cs +++ b/Standard.AI.OpenAI.Tests.Unit/Services/Orchestrations/AIFiles/AIFileOrchestrationServiceTests.cs @@ -46,8 +46,8 @@ public static TheoryData DependencyValidationExceptions() { new LocalFileValidationException(someInnerException), new LocalFileDependencyValidationException(someInnerException), - new AIFileValidationException(someInnerException), - new AIFileDependencyValidationException(someInnerException) + new AIFileValidationException(message: "AI file validation error occurred, fix errors and try again.", someInnerException), + new AIFileDependencyValidationException(message: "AI file dependency validation error occurred, contact support.", someInnerException) }; } @@ -59,8 +59,8 @@ public static TheoryData DependencyExceptions() { new LocalFileDependencyException(someInnerException), new LocalFileServiceException(someInnerException), - new AIFileDependencyException(someInnerException), - new AIFileServiceException(someInnerException), + new AIFileDependencyException(message : "AI file dependency error occurred, contact support.", someInnerException), + new AIFileServiceException(message: "AI file service error occurred, contact support.", someInnerException), }; } @@ -70,8 +70,8 @@ public static TheoryData AIFileServiceDependencyExceptions() return new TheoryData { - new AIFileDependencyException(someInnerException), - new AIFileServiceException(someInnerException), + new AIFileDependencyException(message : "AI file dependency error occurred, contact support.", someInnerException), + new AIFileServiceException(message: "AI file service error occurred, contact support.", someInnerException), }; } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyException.cs index 88224d68..70f1d769 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyException.cs @@ -8,11 +8,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class AIFileDependencyException : Xeption { - public AIFileDependencyException(Xeption innerException) - : base( - message: "AI file dependency error occurred, contact support.", - innerException: innerException) - { } public AIFileDependencyException(string message, Xeption innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyValidationException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyValidationException.cs index 52d11d2d..4f50536c 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyValidationException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileDependencyValidationException.cs @@ -8,11 +8,7 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class AIFileDependencyValidationException : Xeption { - public AIFileDependencyValidationException(Xeption innerException) - : base( - message: "AI file dependency validation error occurred, contact support.", - innerException: innerException) - { } + public AIFileDependencyValidationException(string message, Xeption innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileServiceException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileServiceException.cs index be7f0690..4a25d951 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileServiceException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileServiceException.cs @@ -8,12 +8,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class AIFileServiceException : Xeption { - public AIFileServiceException(Xeption innerException) - : base( - message: "AI file service error occurred, contact support.", - innerException: innerException) - { } - public AIFileServiceException(string message, Xeption innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileValidationException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileValidationException.cs index ebcd202d..4d2ae442 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileValidationException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/AIFileValidationException.cs @@ -8,12 +8,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class AIFileValidationException : Xeption { - public AIFileValidationException(Xeption innerException) - : base( - message: "AI file validation error occurred, fix errors and try again.", - innerException: innerException) - { } - public AIFileValidationException(string message, Xeption innerException) : base(message, innerException) { } } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/ExcessiveCallAIFileException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/ExcessiveCallAIFileException.cs index 2e39ed38..b1a80cb4 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/ExcessiveCallAIFileException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/ExcessiveCallAIFileException.cs @@ -9,11 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class ExcessiveCallAIFileException : Xeption { - public ExcessiveCallAIFileException(Exception innerException) - : base( - message: "Excessive call error occurred, limit your calls.", - innerException: innerException) - { } public ExcessiveCallAIFileException(string message, Exception innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedAIFileServiceException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedAIFileServiceException.cs index 36757418..764a1307 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedAIFileServiceException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedAIFileServiceException.cs @@ -9,11 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class FailedAIFileServiceException : Xeption { - public FailedAIFileServiceException(Exception innerException) - : base( - message: "Failed AI file service error occurred, contact support.", - innerException: innerException) - { } public FailedAIFileServiceException(string message, Exception innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedServerAIFileException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedServerAIFileException.cs index ab52c002..50eb0210 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedServerAIFileException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/FailedServerAIFileException.cs @@ -9,11 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class FailedServerAIFileException : Xeption { - public FailedServerAIFileException(Exception innerException) - : base( - message: "Failed AI file server error occurred, contact support.", - innerException: innerException) - { } public FailedServerAIFileException(string message, Exception innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidAIFileException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidAIFileException.cs index 70edd201..7363bb83 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidAIFileException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidAIFileException.cs @@ -9,16 +9,10 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class InvalidAIFileException : Xeption { - public InvalidAIFileException() - : base( - message: "Invalid AI file error occurred, fix errors and try again.") + public InvalidAIFileException(string message) + : base(message) { } - public InvalidAIFileException(Exception innerException) - : base( - message: "Invalid AI file error occurred, fix errors and try again.", - innerException: innerException) - { } public InvalidAIFileException(string message, Exception innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidConfigurationAIFileException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidConfigurationAIFileException.cs index 3d7d5251..90a25251 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidConfigurationAIFileException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/InvalidConfigurationAIFileException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class InvalidConfigurationAIFileException : Xeption { - public InvalidConfigurationAIFileException(Exception innerException) - : base( - message: "Invalid AI file configuration error occurred, contact support.", - innerException: innerException) - { } - public InvalidConfigurationAIFileException(string message, Exception innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NotFoundAIFileException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NotFoundAIFileException.cs index ce6f7943..4084b28f 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NotFoundAIFileException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NotFoundAIFileException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class NotFoundAIFileException : Xeption { - public NotFoundAIFileException(Exception innerException) - : base( - message: "Not found AI file error occurred, fix errors and try again.", - innerException: innerException) - { } - public NotFoundAIFileException(string message, Exception innerException) : base(message: message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NullAiFileException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NullAiFileException.cs index e6010317..f5c8cb01 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NullAiFileException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/NullAiFileException.cs @@ -9,9 +9,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public partial class NullAIFileException : Xeption { - public NullAIFileException() - : base( - message: "Ai file is null.") + public NullAIFileException(String message) + : base(message) { } public NullAIFileException(string message, Exception innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/UnauthorizedAIFileException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/UnauthorizedAIFileException.cs index 5757d69e..78d6c96c 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/UnauthorizedAIFileException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIFiles/Exceptions/UnauthorizedAIFileException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIFiles.Exceptions { public class UnauthorizedAIFileException : Xeption { - public UnauthorizedAIFileException(Exception innerException) - : base( - message: "Unauthorized AI file request, fix errors and try again.", - innerException: innerException) - { } - public UnauthorizedAIFileException(string message, Exception innerException) : base(message, innerException) { } } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyException.cs index d46f6ca2..91e66083 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyException.cs @@ -8,12 +8,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { internal class AIModelDependencyException : Xeption { - public AIModelDependencyException(Xeption innerException) - : base( - message: "AI Model dependency error occurred, contact support.", - innerException: innerException) - { } - public AIModelDependencyException(string message, Xeption innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyValidationException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyValidationException.cs index c1c9e541..fc8e31bf 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyValidationException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelDependencyValidationException.cs @@ -8,12 +8,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { internal class AIModelDependencyValidationException : Xeption { - public AIModelDependencyValidationException(Xeption innerException) - : base( - message: "AI Model dependency validation error occurred, fix errors and try again.", - innerException: innerException) - { } - public AIModelDependencyValidationException(string message, Xeption innerException) : base(message: message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelServiceException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelServiceException.cs index 26e26273..6344c33b 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelServiceException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelServiceException.cs @@ -8,11 +8,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class AIModelServiceException : Xeption { - public AIModelServiceException(Xeption innerException) - : base( - message: "AI Model service error occurred, contact support.", - innerException: innerException) - { } public AIModelServiceException(string message, Xeption innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelValidationException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelValidationException.cs index a2eba438..d4071ecd 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelValidationException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/AIModelValidationException.cs @@ -8,11 +8,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class AIModelValidationException : Xeption { - public AIModelValidationException(Xeption innerException) - : base( - message: "AI Model validation error occurred, fix errors and try again.", - innerException: innerException) - { } public AIModelValidationException(string message, Xeption innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/ExcessiveCallAIModelException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/ExcessiveCallAIModelException.cs index ab551e35..ddc0f967 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/ExcessiveCallAIModelException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/ExcessiveCallAIModelException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { internal class ExcessiveCallAIModelException : Xeption { - public ExcessiveCallAIModelException(Exception innerException) - : base( - message: "Excessive call error occurred, limit your calls.", - innerException: innerException) - { } - public ExcessiveCallAIModelException(string message, Exception innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedAIModelServiceException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedAIModelServiceException.cs index 28f50dd1..37bcca2f 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedAIModelServiceException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedAIModelServiceException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class FailedAIModelServiceException : Xeption { - public FailedAIModelServiceException(Exception innerException) - : base( - message: "Failed AI Model Service Exception occurred, please contact support for assistance.", - innerException: innerException) - { } - public FailedAIModelServiceException(string message, Exception innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedServerAIModelException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedServerAIModelException.cs index d0056af7..03dc7abc 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedServerAIModelException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/FailedServerAIModelException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class FailedServerAIModelException : Xeption { - public FailedServerAIModelException(Exception innerException) - : base( - message: "Failed AI Model server error occurred, contact support", - innerException: innerException) - { } - public FailedServerAIModelException(string message, Exception innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidAIModelException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidAIModelException.cs index 25eafc57..f7d09fc0 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidAIModelException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidAIModelException.cs @@ -9,15 +9,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class InvalidAIModelException : Xeption { - public InvalidAIModelException() - : base( - message: "AI Model is invalid.") - { } - - public InvalidAIModelException(Exception innerException) - : base( - message: "AI Model is invalid.", - innerException: innerException) + public InvalidAIModelException(string message) + : base(message) { } public InvalidAIModelException(string message, Exception innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidConfigurationAIModelException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidConfigurationAIModelException.cs index d0b86c1d..45fc3985 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidConfigurationAIModelException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/InvalidConfigurationAIModelException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class InvalidConfigurationAIModelException : Xeption { - public InvalidConfigurationAIModelException(Exception innerException) - : base( - message: "Invalid AI Model configuration error occurred, contact support.", - innerException: innerException) - { } - public InvalidConfigurationAIModelException(string message, Exception innerException) : base(message, innerException) { } } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/NotFoundAIModelException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/NotFoundAIModelException.cs index e60b4fbd..a373f243 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/NotFoundAIModelException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/NotFoundAIModelException.cs @@ -9,11 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class NotFoundAIModelException : Xeption { - public NotFoundAIModelException(Exception innerException) - : base( - message: "AI Model not found.", - innerException: innerException) - { } public NotFoundAIModelException(string message, Exception innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/UnauthorizedAIModelException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/UnauthorizedAIModelException.cs index 7547e067..0ae9b250 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/UnauthorizedAIModelException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AIModels/Exceptions/UnauthorizedAIModelException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AIModels.Exceptions { public class UnauthorizedAIModelException : Xeption { - public UnauthorizedAIModelException(Exception innerException) - : base( - message: "Unauthorized AI Model error occurred, fix errors and try again.", - innerException: innerException) - { } - public UnauthorizedAIModelException(string message, Exception innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyException.cs index 2b57740d..75aa82f5 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyException.cs @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AudioTranscriptions.Exc #pragma warning disable RCS1194 // Implement exception constructors. public class AudioTranscriptionDependencyException : Xeption { - public AudioTranscriptionDependencyException(Xeption innerException) - : base( - message: "Audio transcription dependency error occurred, contact support.", - innerException: innerException) - { } - public AudioTranscriptionDependencyException(string message, Xeption innerException) : base(message, innerException) { } diff --git a/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyValidationException.cs b/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyValidationException.cs index 009b17f8..e312f4e4 100644 --- a/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyValidationException.cs +++ b/Standard.AI.OpenAI/Models/Services/Foundations/AudioTranscriptions/Exceptions/AudioTranscriptionDependencyValidationException.cs @@ -9,11 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.AudioTranscriptions.Exc #pragma warning disable RCS1194 // Implement exception constructors. public class AudioTranscriptionDependencyValidationException : Xeption { - public AudioTranscriptionDependencyValidationException(Xeption innerException) - : base( - message: "Chat completion dependency validation error occurred, fix errors and try again.", - innerException: innerException) - { } public AudioTranscriptionDependencyValidationException(string message, Xeption innerException) : base(message, innerException) diff --git a/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Exceptions.cs b/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Exceptions.cs index 3c901b0c..95d29ae4 100644 --- a/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Exceptions.cs +++ b/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Exceptions.cs @@ -24,67 +24,103 @@ private async ValueTask TryCatch(ReturningAIFileFunction returningAIFile } catch (NullAIFileException nullAIFileException) { - throw new AIFileValidationException(nullAIFileException); + throw new AIFileValidationException( + message: "AI file validation error occurred, fix errors and try again.", + nullAIFileException); } catch (InvalidAIFileException invalidFileException) { - throw new AIFileValidationException(invalidFileException); + throw new AIFileValidationException( + message: "AI file validation error occurred, fix errors and try again.", + invalidFileException); } catch (HttpResponseUrlNotFoundException httpResponseUrlNotFoundException) { var invalidConfigurationFileException = - new InvalidConfigurationAIFileException(httpResponseUrlNotFoundException); + new InvalidConfigurationAIFileException( + message: "Invalid AI file configuration error occurred, contact support.", + httpResponseUrlNotFoundException); - throw new AIFileDependencyException(invalidConfigurationFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + invalidConfigurationFileException); } catch (HttpResponseUnauthorizedException httpResponseUnauthorizedException) { var unauthorizedAIFileException = - new UnauthorizedAIFileException(httpResponseUnauthorizedException); + new UnauthorizedAIFileException( + message: "Unauthorized AI file request, fix errors and try again.", + httpResponseUnauthorizedException); - throw new AIFileDependencyException(unauthorizedAIFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + unauthorizedAIFileException); } catch (HttpResponseForbiddenException httpResponseForbiddenException) { var unauthorizedAIFileException = - new UnauthorizedAIFileException(httpResponseForbiddenException); + new UnauthorizedAIFileException( + message: "Unauthorized AI file request, fix errors and try again.", + httpResponseForbiddenException); - throw new AIFileDependencyException(unauthorizedAIFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + unauthorizedAIFileException); } catch (HttpResponseNotFoundException httpResponseNotFoundException) { var notFoundAIFileException = - new NotFoundAIFileException(httpResponseNotFoundException); + new NotFoundAIFileException( + message: "Not found AI file error occurred, fix errors and try again.", + httpResponseNotFoundException); - throw new AIFileDependencyValidationException(notFoundAIFileException); + throw new AIFileDependencyValidationException( + message: "AI file dependency validation error occurred, contact support.", + notFoundAIFileException); } catch (HttpResponseBadRequestException httpResponseBadRequestException) { var invalidAIFileException = - new InvalidAIFileException(httpResponseBadRequestException); + new InvalidAIFileException( + message: "Invalid AI file error occurred, fix errors and try again.", + httpResponseBadRequestException); - throw new AIFileDependencyValidationException(invalidAIFileException); + throw new AIFileDependencyValidationException( + message: "AI file dependency validation error occurred, contact support.", + invalidAIFileException); } catch (HttpResponseTooManyRequestsException httpResponseTooManyRequestsException) { var excessiveCallAIFileException = - new ExcessiveCallAIFileException(httpResponseTooManyRequestsException); + new ExcessiveCallAIFileException( + message: "Excessive call error occurred, limit your calls.", + httpResponseTooManyRequestsException); - throw new AIFileDependencyValidationException(excessiveCallAIFileException); + throw new AIFileDependencyValidationException( + message: "AI file dependency validation error occurred, contact support.", + excessiveCallAIFileException); } catch (HttpResponseException httpResponseException) { var failedServerAIFileException = - new FailedServerAIFileException(httpResponseException); + new FailedServerAIFileException( + message: "Failed AI file server error occurred, contact support.", + httpResponseException); - throw new AIFileDependencyException(failedServerAIFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + failedServerAIFileException); } catch (Exception exception) { var failedAIFileServiceException = - new FailedAIFileServiceException(exception); + new FailedAIFileServiceException( + message: "Failed AI file service error occurred, contact support.", + exception); - throw new AIFileServiceException(failedAIFileServiceException); + throw new AIFileServiceException( + message: "AI file service error occurred, contact support.", + failedAIFileServiceException); } } @@ -97,44 +133,68 @@ private async ValueTask> TryCatch(ReturningAIFilesFu catch (HttpResponseUrlNotFoundException httpResponseUrlNotFoundException) { var invalidConfigurationAIFileException = - new InvalidConfigurationAIFileException(httpResponseUrlNotFoundException); + new InvalidConfigurationAIFileException( + message: "Invalid AI file configuration error occurred, contact support.", + httpResponseUrlNotFoundException); - throw new AIFileDependencyException(invalidConfigurationAIFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + invalidConfigurationAIFileException); } catch (HttpResponseUnauthorizedException httpResponseUnauthorizedException) { var unauthorizedAIFileException = - new UnauthorizedAIFileException(httpResponseUnauthorizedException); + new UnauthorizedAIFileException( + message: "Unauthorized AI file request, fix errors and try again.", + httpResponseUnauthorizedException); - throw new AIFileDependencyException(unauthorizedAIFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + unauthorizedAIFileException); } catch (HttpResponseForbiddenException httpResponseForbiddenException) { var unauthorizedAIFileException = - new UnauthorizedAIFileException(httpResponseForbiddenException); + new UnauthorizedAIFileException( + message: "Unauthorized AI file request, fix errors and try again.", + httpResponseForbiddenException); - throw new AIFileDependencyException(unauthorizedAIFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + unauthorizedAIFileException); } catch (HttpResponseTooManyRequestsException httpResponseTooManyRequestsException) { var excessiveCallAIFileException = - new ExcessiveCallAIFileException(httpResponseTooManyRequestsException); + new ExcessiveCallAIFileException( + message: "Excessive call error occurred, limit your calls.", + httpResponseTooManyRequestsException); - throw new AIFileDependencyValidationException(excessiveCallAIFileException); + throw new AIFileDependencyValidationException( + message: "AI file dependency validation error occurred, contact support.", + excessiveCallAIFileException); } catch (HttpResponseException httpResponseException) { var failedServerAIFileException = - new FailedServerAIFileException(httpResponseException); + new FailedServerAIFileException( + message: "Failed AI file server error occurred, contact support.", + httpResponseException); - throw new AIFileDependencyException(failedServerAIFileException); + throw new AIFileDependencyException( + message: "AI file dependency error occurred, contact support.", + failedServerAIFileException); } catch (Exception exception) { var failedAIFileServiceException = - new FailedAIFileServiceException(exception); + new FailedAIFileServiceException( + message: "Failed AI file service error occurred, contact support.", + exception); - throw new AIFileServiceException(failedAIFileServiceException); + throw new AIFileServiceException( + message: "AI file service error occurred, contact support.", + failedAIFileServiceException); } } } diff --git a/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Validations.cs b/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Validations.cs index 68f5fc7c..02fc495e 100644 --- a/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Validations.cs +++ b/Standard.AI.OpenAI/Services/Foundations/AIFiles/AIFileService.Validations.cs @@ -27,7 +27,7 @@ private static void ValidateAIFileNotNull(AIFile aiFile) { if (aiFile is null) { - throw new NullAIFileException(); + throw new NullAIFileException(message: "Ai file is null."); } } @@ -48,7 +48,7 @@ private static void ValidateFileId(string fileId) => private static void Validate(params (dynamic Rule, string Parameter)[] validations) { - var invalidAIFileException = new InvalidAIFileException(); + var invalidAIFileException = new InvalidAIFileException(message: "Invalid AI file error occurred, fix errors and try again."); foreach ((dynamic rule, string parameter) in validations) { diff --git a/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Exceptions.cs b/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Exceptions.cs index f16afaf0..7b04d4c2 100644 --- a/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Exceptions.cs +++ b/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Exceptions.cs @@ -24,63 +24,96 @@ private async ValueTask TryCatch(ReturningAIModelFunction returningAIMo } catch (InvalidAIModelException invalidAIModelException) { - throw new AIModelValidationException(invalidAIModelException); + throw new AIModelValidationException( + message: "AI Model validation error occurred, fix errors and try again.", + invalidAIModelException); } catch (HttpResponseUrlNotFoundException httpResponseUrlNotFoundException) { var invalidConfigurationAIModelException = - new InvalidConfigurationAIModelException(httpResponseUrlNotFoundException); + new InvalidConfigurationAIModelException( + message: "Invalid AI Model configuration error occurred, contact support.", + httpResponseUrlNotFoundException); - throw new AIModelDependencyException(invalidConfigurationAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + invalidConfigurationAIModelException); } catch (HttpResponseUnauthorizedException httpResponseUnauthorizedException) { var unauthorizedAIModelException = - new UnauthorizedAIModelException(httpResponseUnauthorizedException); + new UnauthorizedAIModelException( + message: "Unauthorized AI Model error occurred, fix errors and try again.", + httpResponseUnauthorizedException); - throw new AIModelDependencyException(unauthorizedAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + unauthorizedAIModelException); } catch (HttpResponseForbiddenException httpResponseForbiddenException) { var unauthorizedAIModelException = - new UnauthorizedAIModelException(httpResponseForbiddenException); + new UnauthorizedAIModelException( + message: "Unauthorized AI Model error occurred, fix errors and try again.", + httpResponseForbiddenException); - throw new AIModelDependencyException(unauthorizedAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + unauthorizedAIModelException); } catch (HttpResponseNotFoundException httpResponseNotFoundException) { var notFoundAIModelException = - new NotFoundAIModelException(httpResponseNotFoundException); + new NotFoundAIModelException( + message: "AI Model not found.", + httpResponseNotFoundException); - throw new AIModelDependencyValidationException(notFoundAIModelException); + throw new AIModelDependencyValidationException( + message: "AI Model dependency validation error occurred, fix errors and try again.", + notFoundAIModelException); } catch (HttpResponseBadRequestException httpResponseBadRequestException) { var invalidAIModelException = - new InvalidAIModelException(httpResponseBadRequestException); + new InvalidAIModelException( + message: "AI Model is invalid.", + httpResponseBadRequestException); - throw new AIModelDependencyValidationException(invalidAIModelException); + throw new AIModelDependencyValidationException( + message: "AI Model dependency validation error occurred, fix errors and try again.", + invalidAIModelException); } catch (HttpResponseTooManyRequestsException httpResponseTooManyRequestsException) { var excessiveCallAIModelException = - new ExcessiveCallAIModelException(httpResponseTooManyRequestsException); + new ExcessiveCallAIModelException( + message: "Excessive call error occurred, limit your calls.", + httpResponseTooManyRequestsException); - throw new AIModelDependencyValidationException(excessiveCallAIModelException); + throw new AIModelDependencyValidationException( + message: "AI Model dependency validation error occurred, fix errors and try again.", + excessiveCallAIModelException); } catch (HttpResponseException httpResponseException) { var failedServerAIModelException = - new FailedServerAIModelException(httpResponseException); + new FailedServerAIModelException( + message: "Failed AI Model server error occurred, contact support", + httpResponseException); - throw new AIModelDependencyException(failedServerAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + failedServerAIModelException); } catch (Exception exception) { var failedAIModelServiceException = - new FailedAIModelServiceException(exception); + new FailedAIModelServiceException( + message: "Failed AI Model Service Exception occurred, please contact support for assistance.", + exception); throw new AIModelServiceException( + message: "AI Model service error occurred, contact support.", failedAIModelServiceException); } } @@ -94,44 +127,67 @@ private async ValueTask> TryCatch(ReturningAIModelsFunction catch (HttpResponseUrlNotFoundException httpResponseUrlNotFoundException) { var invalidConfigurationAIModelException = - new InvalidConfigurationAIModelException(httpResponseUrlNotFoundException); + new InvalidConfigurationAIModelException( + message: "Invalid AI Model configuration error occurred, contact support.", + httpResponseUrlNotFoundException); - throw new AIModelDependencyException(invalidConfigurationAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + invalidConfigurationAIModelException); } catch (HttpResponseUnauthorizedException httpResponseUnauthorizedException) { var unauthorizedAIModelException = - new UnauthorizedAIModelException(httpResponseUnauthorizedException); + new UnauthorizedAIModelException( + message: "Unauthorized AI Model error occurred, fix errors and try again.", + httpResponseUnauthorizedException); - throw new AIModelDependencyException(unauthorizedAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + unauthorizedAIModelException); } catch (HttpResponseForbiddenException httpResponseForbiddenException) { var unauthorizedAIModelException = - new UnauthorizedAIModelException(httpResponseForbiddenException); + new UnauthorizedAIModelException( + message: "Unauthorized AI Model error occurred, fix errors and try again.", + httpResponseForbiddenException); - throw new AIModelDependencyException(unauthorizedAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + unauthorizedAIModelException); } catch (HttpResponseTooManyRequestsException httpResponseTooManyRequestsException) { var excessiveCallAIModelException = - new ExcessiveCallAIModelException(httpResponseTooManyRequestsException); + new ExcessiveCallAIModelException( + message: "Excessive call error occurred, limit your calls.", + httpResponseTooManyRequestsException); - throw new AIModelDependencyValidationException(excessiveCallAIModelException); + throw new AIModelDependencyValidationException( + message: "AI Model dependency validation error occurred, fix errors and try again.", + excessiveCallAIModelException); } catch (HttpResponseException httpResponseException) { var failedServerAIModelException = - new FailedServerAIModelException(httpResponseException); + new FailedServerAIModelException( + message: "Failed AI Model server error occurred, contact support", + httpResponseException); - throw new AIModelDependencyException(failedServerAIModelException); + throw new AIModelDependencyException( + message: "AI Model dependency error occurred, contact support.", + failedServerAIModelException); } catch (Exception exception) { var failedAIModelServiceException = - new FailedAIModelServiceException(exception); + new FailedAIModelServiceException( + message: "Failed AI Model Service Exception occurred, please contact support for assistance.", + exception); throw new AIModelServiceException( + message: "AI Model service error occurred, contact support.", failedAIModelServiceException); } } diff --git a/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Validations.cs b/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Validations.cs index 5c8e67b5..d44dc356 100644 --- a/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Validations.cs +++ b/Standard.AI.OpenAI/Services/Foundations/AIModels/AIModelService.Validations.cs @@ -21,7 +21,7 @@ private static void ValidateAIModelName(string aiModelName) => private static void Validate(params (dynamic Rule, string Parameter)[] validations) { - var invalidAIModelException = new InvalidAIModelException(); + var invalidAIModelException = new InvalidAIModelException(message: "AI Model is invalid."); foreach ((dynamic rule, string parameter) in validations) { diff --git a/Standard.AI.OpenAI/Services/Foundations/AudioTranscriptions/AudioTranscriptionService.Exceptions.cs b/Standard.AI.OpenAI/Services/Foundations/AudioTranscriptions/AudioTranscriptionService.Exceptions.cs index 0a729e95..0e4faebe 100644 --- a/Standard.AI.OpenAI/Services/Foundations/AudioTranscriptions/AudioTranscriptionService.Exceptions.cs +++ b/Standard.AI.OpenAI/Services/Foundations/AudioTranscriptions/AudioTranscriptionService.Exceptions.cs @@ -34,35 +34,45 @@ private static async ValueTask TryCatch( var invalidConfigurationAudioTranscriptionException = new InvalidConfigurationAudioTranscriptionException(httpResponseUrlNotFoundException); - throw new AudioTranscriptionDependencyException(invalidConfigurationAudioTranscriptionException); + throw new AudioTranscriptionDependencyException( + message: "Audio transcription dependency error occurred, contact support.", + invalidConfigurationAudioTranscriptionException); } catch (HttpResponseUnauthorizedException httpResponseUnauthorizedException) { var unauthorizedAudioTranscriptionException = new UnauthorizedAudioTranscriptionException(httpResponseUnauthorizedException); - throw new AudioTranscriptionDependencyException(unauthorizedAudioTranscriptionException); + throw new AudioTranscriptionDependencyException( + message: "Audio transcription dependency error occurred, contact support.", + unauthorizedAudioTranscriptionException); } catch (HttpResponseForbiddenException httpResponseForbiddenException) { var unauthorizedAudioTranscriptionException = new UnauthorizedAudioTranscriptionException(httpResponseForbiddenException); - throw new AudioTranscriptionDependencyException(unauthorizedAudioTranscriptionException); + throw new AudioTranscriptionDependencyException( + message: "Audio transcription dependency error occurred, contact support.", + unauthorizedAudioTranscriptionException); } catch (HttpResponseBadRequestException httpResponseBadRequestException) { var invalidAudioTranscriptionException = new InvalidAudioTranscriptionException(httpResponseBadRequestException); - throw new AudioTranscriptionDependencyValidationException(invalidAudioTranscriptionException); + throw new AudioTranscriptionDependencyValidationException( + message: "Chat completion dependency validation error occurred, fix errors and try again.", + invalidAudioTranscriptionException); } catch (HttpResponseTooManyRequestsException httpResponseTooManyRequestsException) { var excessiveCallAudioTranscriptionException = new ExcessiveCallAudioTranscriptionException(httpResponseTooManyRequestsException); - throw new AudioTranscriptionDependencyValidationException(excessiveCallAudioTranscriptionException); + throw new AudioTranscriptionDependencyValidationException( + message: "Chat completion dependency validation error occurred, fix errors and try again.", + excessiveCallAudioTranscriptionException); } catch (Exception exception) {