Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CODE RUB: FollowUp CodeCleanUp V2.10.1 #563

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ private Filler<AIFile> CreateAIFileFiller()
return filler;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ private static Filler<ChatCompletion> ChatCompletionFiller()
return filler;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ private async Task ShouldThrowValidationExceptionOnPromptIfRequestIsNullAsync()
invalidCompletion.Request = null;

var invalidCompletionException =
CreateInvalidCompletionException();
new InvalidCompletionException(
message: "Invalid completion error occurred, fix errors and try again.");

invalidCompletionException.AddData(
key: nameof(Completion.Request),
Expand Down Expand Up @@ -106,7 +107,8 @@ private async Task ShouldThrowValidationExceptionOnPromptIfCompletionIsInvalidAs
};

var invalidCompletionException =
CreateInvalidCompletionException();
new InvalidCompletionException(
message: "Invalid completion error occurred, fix errors and try again.");

invalidCompletionException.AddData(
key: nameof(CompletionRequest.Model),
Expand Down Expand Up @@ -150,7 +152,8 @@ private async Task ShouldThrowValidationExceptionOnPromptIfPromptIsEmptyAsync()
};

var invalidCompletionException =
CreateInvalidCompletionException();
new InvalidCompletionException(
message: "Invalid completion error occurred, fix errors and try again.");

invalidCompletionException.AddData(
key: nameof(CompletionRequest.Prompts),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,5 @@ private static Filler<Completion> CreateCompletionFiller()

return filler;
}

private static InvalidCompletionException CreateInvalidCompletionException()
{
return new InvalidCompletionException(
message: "Invalid completion error occurred, fix errors and try again.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ private async Task ShouldThrowValidationExceptionOnSubmitIfFineTuneRequestIsNull
fineTune.Request = nullFineTuneRequest;

var invalidFineTuneException =
createInvalidFineTuneException();
new InvalidFineTuneException(
message: "Fine tune is invalid.");

invalidFineTuneException.AddData(
key: nameof(FineTune.Request),
Expand Down Expand Up @@ -106,7 +107,8 @@ private async Task ShouldThrowValidationExceptionOnSubmitIfFineTuneRequestIsInva
invalidFineTune.Request = new FineTuneRequest();
invalidFineTune.Request.FileId = invalidText;
var invalidFineTuneException =
createInvalidFineTuneException();
new InvalidFineTuneException(
message: "Fine tune is invalid.");

invalidFineTuneException.AddData(
key: nameof(FineTuneRequest.FileId),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,5 @@ private static Filler<FineTune> CreateRandomFineTuneFiller()

return filler;
}

private InvalidFineTuneException createInvalidFineTuneException()
{
return new InvalidFineTuneException(
message: "Fine tune is invalid.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ private async Task ShouldThrowValidationExceptionOnGenerateIfRequestIsNullAsync(
invalidImageGeneration.Request = null;

var invalidImageGenerationException =
CreateInvalidImageGenerationException();
new InvalidImageGenerationException(
message: "Invalid image generation error occurred, fix errors and try again.");

invalidImageGenerationException.AddData(
key: nameof(ImageGeneration.Request),
Expand Down Expand Up @@ -107,7 +108,8 @@ private async Task ShouldThrowValidationExceptionOnGenerateIfRequestIsInvalidAsy
};

var invalidImageGenerationException =
CreateInvalidImageGenerationException();
new InvalidImageGenerationException(
message: "Invalid image generation error occurred, fix errors and try again.");

invalidImageGenerationException.AddData(
key: nameof(ImageGeneration.Request.Prompt),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,5 @@ public static TheoryData UnauthorizedExceptions()
new HttpResponseForbiddenException()
};
}

private static InvalidImageGenerationException CreateInvalidImageGenerationException()
{
return new InvalidImageGenerationException(
message: "Invalid image generation error occurred, fix errors and try again.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class InvalidCompletionException : Xeption
public InvalidCompletionException(string message)
: base(message)
{ }

public InvalidCompletionException(string message, Exception innerException)
: base(message, innerException)
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public ExcessiveCallImageGenerationException(string message, Exception innerExce
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public FailedLocalFileDependencyException(string message, Exception innerExcepti
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public FailedLocalFileServiceException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ public InvalidLocalFileException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public LocalFileDependencyException(string message, Xeption innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public LocalFileDependencyValidationException(string message, Xeption innerExcep
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public LocalFileServiceException(string message, Xeption innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public LocalFileValidationException(string message, Xeption innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ public NotFoundLocalFileException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ private static NullAIFileOrchestrationException CreateNullAIFileOrchestrationExc
message: "AI file is null.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ private static void Validate(params (dynamic Rule, string Parameter)[] validatio
invalidAIFileException.ThrowIfContainsErrors();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ internal interface IAIFileOrchestrationService
ValueTask<IEnumerable<AIFileResponse>> RetrieveAllFilesAsync();
ValueTask<AIFile> RemoveFileByIdAsync(string fileId);
}
}
}
Loading