File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 5959# This ensures the consumer and auth check happen at module load time
6060try :
6161 _langfuse = Langfuse (
62+ public_key = os .environ .get ("LANGFUSE_PUBLIC_KEY" ),
63+ secret_key = os .environ .get ("LANGFUSE_SECRET_KEY" ),
64+ host = os .environ .get ("LANGFUSE_HOST" ),
6265 debug = DEBUG
6366 )
67+ # Configure the global langfuse_context to use our explicit client instance
68+ # This ensures @observe decorator and langfuse_context use the same client
69+ langfuse_context .configure (_langfuse )
6470 if DEBUG :
65- logger .info ("Langfuse client initialized successfully" )
71+ logger .info ("Langfuse client initialized and configured successfully" )
6672except Exception as e :
6773 logger .warning (f"Failed to initialize Langfuse client: { e } " )
6874 _langfuse = None
You can’t perform that action at this time.
0 commit comments