langchain4j 工具在返回NaN时失败

fzwojiic  于 4个月前  发布在  其他
关注(0)|答案(1)|浏览(48)

Double getFactor(@p("asset id") String id) {
double factor = getFactor(id); // do some maths here ...
if (Double.isNaN(factor)) {
throw new IllegalArgumentException("NaN is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialFloatingPointValues() method.");
}
return factor;
}

kokeuurv

kokeuurv1#

你好,algotechnology,在这种情况下,你期望如何序列化它?"NaN"字符串?

相关问题