Class CostEstimatorService

java.lang.Object
io.quarkiverse.langchain4j.cost.CostEstimatorService

@Singleton @Experimental("This feature is experimental and the API is subject to change") public class CostEstimatorService extends Object
Meant to be injected where ChatModelListener is used in order to determine the cost of the API request
  • Constructor Details

    • CostEstimatorService

      public CostEstimatorService(List<CostEstimator> costEstimators)
  • Method Details

    • estimate

      public Cost estimate(dev.langchain4j.model.chat.listener.ChatModelResponseContext response)