Skip to content

Commit

Permalink
Reactivate langfuse handler
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowcap committed Feb 11, 2025
1 parent 93dc1dd commit 332595c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from fastapi.responses import Response, StreamingResponse
from langchain_core.messages import HumanMessage
from langgraph.types import Command
from langfuse.callback import CallbackHandler

from zeno.agents.distalert.graph import graph as dist_alert
from zeno.agents.docfinder.graph import graph as docfinder
Expand All @@ -21,7 +22,10 @@


app = FastAPI()
# # langfuse_handler = CallbackHandler()

callbacks = []
if "LANGFUSE_PUBLIC_KEY" in os.environ:
callbacks.append(CallbackHandler())

app.add_middleware(
CORSMiddleware,
Expand All @@ -46,7 +50,7 @@ def event_stream_alerts(
thread_id = str(uuid.uuid4())

config = {
# "callbacks": [langfuse_handler],
"callbacks": callbacks,
"configurable": {"thread_id": thread_id},
}

Expand Down

0 comments on commit 332595c

Please sign in to comment.