Skip to content

Commit

Permalink
Merge pull request #3392 from BerriAI/litellm_fix_langfuse_reinitalized
Browse files Browse the repository at this point in the history
[Fix] bug where langfuse was reinitialized on every call
  • Loading branch information
ishaan-jaff committed May 2, 2024
2 parents e16ca10 + 8a3d8f8 commit 7ffe410
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions litellm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1695,10 +1695,17 @@ def success_handler(
print_verbose("reaches langfuse for streaming logging!")
result = kwargs["complete_streaming_response"]
if langFuseLogger is None or (
self.langfuse_public_key != langFuseLogger.public_key
and self.langfuse_secret != langFuseLogger.secret_key
(
self.langfuse_public_key is not None
and self.langfuse_public_key
!= langFuseLogger.public_key
)
and (
self.langfuse_public_key is not None
and self.langfuse_public_key
!= langFuseLogger.public_key
)
):
print_verbose("Instantiates langfuse client")
langFuseLogger = LangFuseLogger(
langfuse_public_key=self.langfuse_public_key,
langfuse_secret=self.langfuse_secret,
Expand Down

0 comments on commit 7ffe410

Please sign in to comment.