All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.langchain4j.cost.Cost Maven / Gradle / Ivy

There is a newer version: 0.21.0
Show newest version
package io.quarkiverse.langchain4j.cost;

import java.math.BigDecimal;

public record Cost(BigDecimal number, String currencyCode) {

    public static Cost of(BigDecimal number, String currencyCode) {
        return new Cost(number == null ? BigDecimal.ZERO : number, currencyCode == null ? "UNKNOWN" : currencyCode);
    }

    @Override
    public String toString() {
        return number.toPlainString() + currencyCode;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy