Replies: 2 comments
-
To set token usage details using the low-level SDK so that the input, total, and output values show up for overall traces, you can use the langfuse.generation(
name="my-generation",
usage_details={
"input": 50,
"output": 49,
"total": 99,
}
) This will set the input, output, and total token usage details for the generation, which will be reflected in the overall traces [1]. Additionally, ensure that you are using the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
-
That is what I am doing, but its not working for langfuse 2.95.0, I am using low level sdk and not using any decorators. |
Beta Was this translation helpful? Give feedback.
-
Here is what my code does:
If I run the above code, I can see that the overall trace's metadata looks like:
From the documentation, it looks like I made the usage_details object as desired. Above shows that my
usage
dict was:How do I get these three to actually show up for overall traces? Right now I just see this in the traces page:

Beta Was this translation helpful? Give feedback.
All reactions