Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions chat/openwebui_functions/studio_langfuse_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ async def user_message(self, message, history, user_message, chat_id=None, __use
return user_message
payload = {
"body": {
"chat_id": chat_id or str(uuid.uuid4()),
"messages": [dict(m) for m in (history or [])] + [{"role": "user", "content": user_message}],
"model": kwargs.get("model") or {},
"metadata": {"chat_id": chat_id or str(uuid.uuid4())},
},
"user": self._user_payload(__user__),
}
Expand All @@ -100,7 +100,6 @@ async def after_chat_completion(self, content, context=None, __user__=None, **kw
"body": {
"chat_id": ctx.get("chat_id") or "local",
"messages": messages,
"metadata": ctx.get("metadata") or {},
},
"user": self._user_payload(__user__),
}
Expand Down
2 changes: 1 addition & 1 deletion chat/pipelines_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _get_langfuse():

def _chat_id(body: dict) -> str:
metadata = body.get("metadata") or {}
chat_id = metadata.get("chat_id") or "local"
chat_id = body.get("chat_id") or metadata.get("chat_id") or "local"
if chat_id == "local":
session_id = metadata.get("session_id")
chat_id = f"temporary-session-{session_id}" if session_id else str(uuid.uuid4())
Expand Down
Loading