Skip to content

How to use langfuse in langchain-chatchat #3225

Closed Answered by daocaorenzzl
daocaorenzzl asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you for your answer. The above three variables did take effect in the operating system. The problem has been solved by modifying the source code of langchain-chatchat.

Make sure that LANGFUSE_SECRET_KEY, LANGFUSE_PUBLIC_KEY, and LANGFUSE_HOST are correctly configured in the system environment, and then make the following modifications:
vim Langchain-Chatchat/server/chat/chat.py
after line 48: callbacks.append(conversation_callback)

  •  # Try to support langfuse
    
  •  import os
    
  •  langfuse_secret_key = os.environ.get('LANGFUSE_SECRET_KEY')
    
  •  langfuse_public_key = os.environ.get('LANGFUSE_PUBLIC_KEY')
    
  •  langfuse_host = os.environ.get('LANGFUSE_HOST')
    
  •  if langfuse_secret_key and l…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@daocaorenzzl
Comment options

Answer selected by daocaorenzzl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant