Is unit accepted in usage_detail #19548
Replies: 2 comments
|
No. Langfuse treats every key in { "input_characters": 13, "output_characters": 40 }Over OTEL, send it as the JSON attribute |
|
it won't be rejected, it just gets dropped. for OTEL, Langfuse reads so the "unit" is defined by the model definition instead. prices are per usage type, and the keys have to match the in Go: usage, _ := json.Marshal(map[string]int{"input": 13}) // 13 characters
span.SetAttributes(
attribute.String("langfuse.observation.type", "generation"),
attribute.String("langfuse.observation.model.name", "my-char-model"),
attribute.String("langfuse.observation.usage_details", string(usage)),
)(attribute names from the OTEL mapping, checked with otel-go 1.47.0 that it emits |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe your question
I am using OTEL for langfuse and want to check if something like this will be accepted to put the unit in usageDetails. For context I am using golang.
Langfuse Cloud or Self-Hosted?
Langfuse Cloud
If Self-Hosted
No response
If Langfuse Cloud
https://gmlp-logistics-langfuse-stg.deliveryhero.io/
SDK and integration versions
we are using OTEL
Pre-Submission Checklist
All reactions