Skip to content

Commit

Permalink
Merge pull request #563 from Lezune/user/lezune/coderub-cleanup-v2101
Browse files Browse the repository at this point in the history
CODE RUB: FollowUp CodeCleanUp V2.10.1
  • Loading branch information
glhays authored Jun 13, 2024
2 parents 13ff551 + a7bf768 commit f0926e6
Show file tree
Hide file tree
Showing 21 changed files with 30 additions and 40 deletions.
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);
}
}
}

0 comments on commit f0926e6

Please sign in to comment.