File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -1186,17 +1186,22 @@ def create_langfuse_callback(version: str) -> None:
11861186 )
11871187 try :
11881188 # use litellm's callbacks for chatlitellm backend
1189- litellm .success_callback .append ("langfuse" )
1190- litellm .failure_callback .append ("langfuse" )
1191-
11921189 # # and use langchain's callback for openai's backend
11931190 # BUT as of october 2024 it seems buggy with chatlitellm, the modelname does not seem to be passed?
11941191 try :
11951192 from langfuse .callback import CallbackHandler as LangfuseCallback
1193+
1194+ litellm .success_callback .append ("langfuse" )
1195+ litellm .failure_callback .append ("langfuse" )
1196+
11961197 except (ImportError , AttributeError ):
11971198 # import changed for langfuse v3: https://github.com/langfuse/langfuse/issues/7205
11981199 from langfuse .langchain import CallbackHandler as LangfuseCallback
11991200
1201+ # v3 switched to open telemetry: https://github.com/BerriAI/litellm/issues/11500
1202+ litellm .success_callback .append ("langfuse_otel" )
1203+ litellm .failure_callback .append ("langfuse_otel" )
1204+
12001205 langfuse_callback = LangfuseCallback (
12011206 secret_key = os .environ ["LANGFUSE_SECRET_KEY" ],
12021207 public_key = os .environ ["LANGFUSE_PUBLIC_KEY" ],
You can’t perform that action at this time.
0 commit comments