Fixed missing proper exception in AIProvider
This commit is contained in:
@@ -106,7 +106,7 @@ public class AIProvider
|
|||||||
if (responseContentTokens is null)
|
if (responseContentTokens is null)
|
||||||
{
|
{
|
||||||
_logger.LogError("Unable to select tokens using JSONPath {embeddingsJsonPath} for string: {responseContent}.", [embeddingsJsonPath, responseContent]);
|
_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>()];
|
return [.. responseContentTokens.Values<float>()];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,6 @@ namespace Server.Exceptions;
|
|||||||
|
|
||||||
public class ProbMethodNotFoundException(string probMethod) : Exception($"Unknown probMethod name {probMethod}") { }
|
public class ProbMethodNotFoundException(string probMethod) : Exception($"Unknown probMethod name {probMethod}") { }
|
||||||
|
|
||||||
public class SimilarityMethodNotFoundException(string similarityMethod) : Exception($"Unknown similarityMethod name \"{similarityMethod}\"") { }
|
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