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: Foundations ChatCompletions Exceptions Update v2.10.1 #556

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bed3dd3
Updated ChatCompletionDependencyException class by removing construct…
Lezune May 30, 2024
19a6809
Updated ChatCompletionDependencyValidationException class by removing…
Lezune May 30, 2024
d77e497
Updated ChatCompletionServiceException class by removing constructors…
Lezune May 30, 2024
17260c1
Updated ChatCompletionValidationException class by removing construct…
Lezune May 30, 2024
d240c9d
Updated ExcessiveCallChatCompletionException class by removing constr…
Lezune May 30, 2024
51f8c94
Updated FailedChatCompletionServiceException class by removing constr…
Lezune May 30, 2024
32a91b5
Updated FailedServerChatCompletionException class by removing constru…
Lezune May 30, 2024
fa0f8c1
Updated InvalidChatCompletionException class by removing constructors…
Lezune May 30, 2024
8c3e56d
Updated InvalidConfigurationChatCompletionException class by removing…
Lezune May 30, 2024
2e0426c
Updated NotFoundChatCompletionException class by removing constructor…
Lezune May 30, 2024
f3a2430
Updated UnauthorizedChatCompletionException class by removing constru…
Lezune May 30, 2024
580c121
Added create methods to both ChatCompletions.Exceptions.cs and ChatCo…
Lezune May 31, 2024
a8b716c
Added create methods to both ChatCompletions.Exceptions.cs and ChatCo…
Lezune May 31, 2024
b303722
Added create methods to both ChatCompletions.Exceptions.cs and ChatCo…
Lezune May 31, 2024
c21ac0c
Added create methods to both ChatCompletions.Exceptions.cs and ChatCo…
Lezune May 31, 2024
efdd319
Updated NullChatCompletionException class's constructor in which the …
Lezune May 31, 2024
7e584b3
Added create methods to both ChatCompletions.Exceptions.cs and ChatCo…
Lezune May 31, 2024
63a7cb0
Reverted Unit Test files and updated create method declaration and ca…
Lezune Jun 6, 2024
42f4a89
Updated create method to adhere to method naming standards
Lezune Jun 6, 2024
2ebbe8d
Reverted Unit Test files to original state
Lezune Jun 6, 2024
c9d8b40
Updated create method to adhere to method naming standards
Lezune Jun 6, 2024
bdf3ef9
Reverted Unit Test files to original state
Lezune Jun 6, 2024
5780832
Updated create method to adhere to method naming standards
Lezune Jun 6, 2024
09f3b34
Updated create method to adhere to method naming standards
Lezune Jun 6, 2024
fbb55e7
Resolved merge conflicts with users/Lezune/Foundations-ChatCompletion…
Lezune Jun 10, 2024
bdb8e7d
Merge branch 'users/Lezune/Foundations-ChatCompletions-ChatCompletion…
Lezune Jun 10, 2024
468a5cc
resolved merge conflicts with users/Lezune/Foundations-ChatCompletion…
Lezune Jun 10, 2024
d16692c
Merge branch 'users/Lezune/Foundations-ChatCompletions-ExcessiveCallC…
Lezune Jun 10, 2024
07b7665
Merge branch 'users/Lezune/Foundations-ChatCompletions-FailedChatComp…
Lezune Jun 10, 2024
1d06d4e
Merge branch 'users/Lezune/Foundations-ChatCompletions-FailedServerCh…
Lezune Jun 10, 2024
0a8d6cd
Resolved merge conflicts with users/Lezune/Foundations-ChatCompletion…
Lezune Jun 10, 2024
60aa478
Merge branch 'users/Lezune/Foundations-ChatCompletions-InvalidConfigu…
Lezune Jun 10, 2024
41e735b
Merge branch 'users/Lezune/Foundations-ChatCompletions-NotFoundChatCo…
Lezune Jun 10, 2024
50f78ff
Merge branch 'users/Lezune/Foundations-ChatCompletions-NullChatComple…
Lezune Jun 10, 2024
d2a978d
Resolved merge conflicts, Updated & Refactored code
Lezune Jun 10, 2024
946ac0b
Refactored Code
Lezune Jun 11, 2024
0c58219
Refactored Code
Lezune Jun 11, 2024
ebfa48b
Removed Extra lines at the end of files and added line break to metho…
Lezune Jun 13, 2024
79795ef
Added back the line break in class declaration where there was two or…
Lezune Jun 13, 2024
c3fa328
Added a line break for each method declaration that was longer than 1…
Lezune Jun 13, 2024
b9c2df9
Reverted method call to what is was in previous commit
Lezune Jun 13, 2024
8e399f7
Removed create method in the unit test class and refactored code.
Lezune Jun 13, 2024
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 @@ -21,7 +21,8 @@ private async Task ShouldThrowValidationExceptionOnSendIfChatCompletionIsNullAsy
ChatCompletion nullChatCompletion = null;

var nullChatCompletionException =
new NullChatCompletionException();
new NullChatCompletionException(
message: "Chat completion is null.");

var expectedChatCompletionValidationException =
new ChatCompletionValidationException(
Expand Down Expand Up @@ -58,7 +59,8 @@ private async Task ShouldThrowValidationExceptionOnSendIfRequestIsNullAsync()
invalidChatCompletion.Request = null;

var invalidChatCompletionException =
new InvalidChatCompletionException();
new InvalidChatCompletionException(
message: "Chat completion is invalid."); ;

invalidChatCompletionException.AddData(
key: nameof(ChatCompletion.Request),
Expand Down Expand Up @@ -106,7 +108,8 @@ private async Task ShouldThrowValidationExceptionOnSendIfRequestIsInvalidAsync(s
};

var invalidChatCompletionException =
new InvalidChatCompletionException();
new InvalidChatCompletionException(
message: "Chat completion is invalid.");

invalidChatCompletionException.AddData(
key: nameof(ChatCompletion.Request.Model),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
using Standard.AI.OpenAI.Brokers.DateTimes;
using Standard.AI.OpenAI.Brokers.OpenAIs;
using Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions;
using Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Exceptions;
using Standard.AI.OpenAI.Models.Services.Foundations.ExternalChatCompletions;
using Standard.AI.OpenAI.Services.Foundations.ChatCompletions;
using Tynamix.ObjectFiller;
using Xeptions;
using Xunit;

namespace Standard.AI.OpenAI.Tests.Unit.Services.Foundations.ChatCompletions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class ChatCompletionDependencyException : Xeption
{
public ChatCompletionDependencyException(Xeption innerException)
: base(
message: "Chat completion dependency error occurred, contact support.",
innerException: innerException)
{ }

public ChatCompletionDependencyException(string message, Xeption innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class ChatCompletionDependencyValidationException : Xeption
{
public ChatCompletionDependencyValidationException(Xeption innerException)
: base(
message: "Chat completion dependency validation error occurred, fix errors and try again.",
innerException: innerException)
{ }

public ChatCompletionDependencyValidationException(string message, Xeption innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class ChatCompletionServiceException : Xeption
{
public ChatCompletionServiceException(Exception innerException)
: base(
message: "Chat completion service error occurred, contact support.",
innerException: innerException)
{ }

public ChatCompletionServiceException(string message, Exception innerException)
: base(message, innerException)
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class ChatCompletionValidationException : Xeption
{
public ChatCompletionValidationException(Xeption innerException)
: base(
message: "Chat completion validation error occurred, fix errors and try again.",
innerException: innerException)
{ }

public ChatCompletionValidationException(string message, Xeption innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class ExcessiveCallChatCompletionException : Xeption
{
public ExcessiveCallChatCompletionException(Exception innerException)
: base(
message: "Excessive call error occurred, limit your calls.",
innerException: innerException)
{ }

public ExcessiveCallChatCompletionException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class FailedChatCompletionServiceException : Xeption
{
public FailedChatCompletionServiceException(Exception innerException)
: base(
message: "Failed Chat Completion Service Exception occurred, please contact support for assistance.",
innerException: innerException)
{ }

public FailedChatCompletionServiceException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class FailedServerChatCompletionException : Xeption
{
public FailedServerChatCompletionException(Exception innerException)
: base(
message: "Failed chat completion server error occurred, contact support.",
innerException: innerException)
{ }

public FailedServerChatCompletionException(string message, Exception innerException)
: base(message, innerException)
{ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class InvalidChatCompletionException : Xeption
{
public InvalidChatCompletionException()
: base(
message: "Chat completion is invalid.")
{ }

public InvalidChatCompletionException(Exception innerException)
: base(
message: "Chat completion is invalid.",
innerException: innerException)
public InvalidChatCompletionException(string message)
: base(message)
{ }

public InvalidChatCompletionException(string message, Xeption innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class InvalidConfigurationChatCompletionException : Xeption
{
public InvalidConfigurationChatCompletionException(Exception innerException)
: base(
message: "Invalid chat completion configuration error occurred, contact support.",
innerException: innerException)
{ }

public InvalidConfigurationChatCompletionException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class NotFoundChatCompletionException : Xeption
{
public NotFoundChatCompletionException(Exception innerException)
: base(
message: "Chat completion not found.",
innerException: innerException)
{ }

public NotFoundChatCompletionException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class NullChatCompletionException : Xeption
{
public NullChatCompletionException()
: base(
message: "Chat completion is null.")
public NullChatCompletionException(string message)
: base(message)
{ }

public NullChatCompletionException(string message, Xeption innerException)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ namespace Standard.AI.OpenAI.Models.Services.Foundations.ChatCompletions.Excepti
{
public class UnauthorizedChatCompletionException : Xeption
{
public UnauthorizedChatCompletionException(Exception innerException)
: base(
message: "Unauthorized chat completion request, fix errors and try again.",
innerException: innerException)
{ }

public UnauthorizedChatCompletionException(string message, Exception innerException)
: base(message, innerException)
{ }
}
}
}
Loading
Loading