mirror of
https://github.com/open-webui/pipelines
synced 2025-05-12 00:20:48 +00:00
Added Langfuse trace IDs for better chat tracking
This commit is contained in:
parent
b56782af8a
commit
d727b30513
@ -15,7 +15,6 @@ import os
|
|||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from langfuse import Langfuse
|
from langfuse import Langfuse
|
||||||
from langfuse.decorators import langfuse_context, observe
|
|
||||||
|
|
||||||
|
|
||||||
class Pipeline:
|
class Pipeline:
|
||||||
@ -83,7 +82,7 @@ class Pipeline:
|
|||||||
secret_key=self.valves.secret_key,
|
secret_key=self.valves.secret_key,
|
||||||
public_key=self.valves.public_key,
|
public_key=self.valves.public_key,
|
||||||
host=self.valves.host,
|
host=self.valves.host,
|
||||||
debug=True,
|
debug=False,
|
||||||
)
|
)
|
||||||
self.langfuse.auth_check()
|
self.langfuse.auth_check()
|
||||||
|
|
||||||
@ -95,6 +94,7 @@ class Pipeline:
|
|||||||
input=body,
|
input=body,
|
||||||
user_id=user["id"],
|
user_id=user["id"],
|
||||||
metadata={"name": user["name"]},
|
metadata={"name": user["name"]},
|
||||||
|
trace_id=body["chat_id"]
|
||||||
)
|
)
|
||||||
|
|
||||||
print(trace.get_trace_url())
|
print(trace.get_trace_url())
|
||||||
|
Loading…
Reference in New Issue
Block a user