Fixed missing proper exception in AIProvider
This commit is contained in:
@@ -106,7 +106,7 @@ public class AIProvider
|
||||
if (responseContentTokens is null)
|
||||
{
|
||||
_logger.LogError("Unable to select tokens using JSONPath {embeddingsJsonPath} for string: {responseContent}.", [embeddingsJsonPath, responseContent]);
|
||||
throw new Exception($"Unable to select tokens using JSONPath {embeddingsJsonPath} for string: {responseContent}."); // TODO add proper exception
|
||||
throw new JSONPathSelectionException(embeddingsJsonPath, responseContent);
|
||||
}
|
||||
return [.. responseContentTokens.Values<float>()];
|
||||
}
|
||||
|
||||
@@ -3,3 +3,5 @@ namespace Server.Exceptions;
|
||||
public class ProbMethodNotFoundException(string probMethod) : Exception($"Unknown probMethod name {probMethod}") { }
|
||||
|
||||
public class SimilarityMethodNotFoundException(string similarityMethod) : Exception($"Unknown similarityMethod name \"{similarityMethod}\"") { }
|
||||
|
||||
public class JSONPathSelectionException(string path, string testedContent) : Exception($"Unable to select tokens using JSONPath {path} for string: {testedContent}.") { }
|
||||
Reference in New Issue
Block a user