Skip to content

Commit

Permalink
update init_langfuse
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyeh committed Jul 10, 2024
1 parent 81a64b6 commit 69788f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wren-ai-service/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ def remove_trailing_slash(endpoint: str) -> str:

def init_langfuse():
enabled = os.getenv("LANGFUSE_ENABLE", "false")
host = os.getenv("LANGFUSE_HOST", "https://cloud.langfuse.com")

langfuse_context.configure(
enabled=False if enabled.lower() == "false" else True,
public_key=os.getenv("LANGFUSE_PUBLIC_KEY", ""),
secret_key=os.getenv("LANGFUSE_SECRET_KEY", ""),
host=host,
)

logger.info(f"LANGFUSE_ENABLE: {enabled}")
logger.info(f"LANGFUSE_HOST: {host}")

0 comments on commit 69788f6

Please sign in to comment.