Skip to content

Commit b72a101

Browse files
enh: add a unique langfuse session_id by launch of wdoce
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent 6d62ed4 commit b72a101

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wdoc/utils/llm.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from typing import Union, List, Any, Optional
77
import os
88
from typing import Dict
9+
import uuid
910

1011
from langchain_core.callbacks import BaseCallbackHandler
1112
from langchain_core.agents import AgentAction, AgentFinish
@@ -41,6 +42,7 @@
4142
secret_key=os.environ["LANGFUSE_SECRET_KEY"],
4243
public_key=os.environ["LANGFUSE_PUBLIC_KEY"],
4344
host=os.environ["LANGFUSE_HOST"],
45+
session_id=str(uuid.uuid4()),
4446
)]
4547
except Exception as e:
4648
red(f"Failed to setup langfuse callback, make sure package 'langfuse' is installed. The error was: ''{e}'")

0 commit comments

Comments
 (0)