-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Description
Quarkus langchain4j generates some gen_ai usage metrics, including gen_ai_client_estimated_cost_total, which I would expect to contain estimated cost of calls in dollars (or cents). Unfortunately, it uses floating-point number to store/represent the value, which is known anti pattern[1] generally and makes output unclear in our particular use case.
Example (obtained from sample/chatbot module after adding quarkus-micrometer and quarkus-micrometer-registry-prometheusextensions):
gen_ai_client_estimated_cost_total{ai_service_class_name="io.quarkiverse.langchain4j.sample.chatbot.Bot",ai_service_method_name="chat",currency="USD",gen_ai_operation_name="completion",gen_ai_request_model="gpt-4o-mini",gen_ai_response_model="gpt-4o-mini-2024-07-18",gen_ai_token_type="output",} 8.67E-5
[1] eg https://dzone.com/articles/never-use-float-and-double-for-monetary-calculatio
Metadata
Metadata
Assignees
Labels
No labels