pipelines icon indicating copy to clipboard operation
pipelines copied to clipboard

[bug] cannot get Tokens in Langfuse Pipeline

Open anonymousmaharaj opened this issue 1 year ago • 2 comments

In outlet func I got this body for example

{'stream': True, 'model': 'openai/gpt-4o-mini', 'messages': [{'role': 'user', 'content': '****!'}, {'role': 'assistant', 'content': '********'}, {'role': 'user', 'content': '******'}], 'session_id': '0Wvu0hBT7534RXkmAAFX', 'chat_id': '773a5127-7f0a-4471-ab8f-03856556e2cc', 'id': '46a01fdd-9280-4f49-835a-c27c030fc40b'}

There used to be fields with the number of tokens. It used to work fine for me. Now I can't get tokens anywhere. I debugged all the values and now there are no tokens anywhere, so now it is impossible to get tokens? Is this a bug or a feature?

I use Openwebui 0.3.35 (because the new one slows down) and the latest pipeline. Can you tell me what it depends on? I can roll back the pipeline to the right version if that's the reason. I only need it for langfuse.

Pipeline version: git-1367d95

anonymousmaharaj avatar Nov 22 '24 12:11 anonymousmaharaj

I have a feeling it's between open-webui/pipelines/langfuse that do not agree on the name

When I looked at langfuse, the name is under that regex (?i)^(gpt-4o-mini)$ wwhich mean that it wont pickup any prefixed name

rossm-mf avatar Nov 29 '24 20:11 rossm-mf

I a similar issue. I found that the openwebui had changed their json schema that gets passed to pipelines and the example filter had not been update.

in examples/filters/langfuse_filter_pipeline.py on line 242 info = assistant_message_obj.get("info", {})

change it to: info = assistant_message_obj.get("usage", {})

hope that helps

KourFrost avatar Mar 26 '25 02:03 KourFrost