Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
fix: handle missing name in on_retriever_start
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoavidal authored Dec 11, 2024
1 parent d802e14 commit e79c629
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lunary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,7 @@ def on_retriever_start(
query: str,
run_id: Optional[UUID] = None,
parent_run_id: Optional[UUID] = None,
name: Union[str, None] = None,
**kwargs: Any,
) -> None:
try:
Expand All @@ -1412,7 +1413,8 @@ def on_retriever_start(
user_id = _get_user_id(kwargs.get("metadata"))
user_props = _get_user_props(kwargs.get("metadata"))

name = serialized.get("name")
if name is None and serialized:
name = serialized.get("name")

self.__track_event(
"retriever",
Expand Down

0 comments on commit e79c629

Please sign in to comment.