Skip to content
Merged
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
4 changes: 4 additions & 0 deletions langfuse/langchain/CallbackHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def on_retriever_error(
level="ERROR",
status_message=str(error),
input=kwargs.get("inputs"),
cost_details={"total": 0},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good: cost_details set to {"total": 0} on retriever errors. Consider extracting the literal to a constant if used in multiple error handlers.

).end()

except Exception as e:
Expand Down Expand Up @@ -527,6 +528,7 @@ def on_chain_error(
),
status_message=str(error) if level else None,
input=kwargs.get("inputs"),
cost_details={"total": 0},
).end()

except Exception as e:
Expand Down Expand Up @@ -733,6 +735,7 @@ def on_tool_error(
status_message=str(error),
level="ERROR",
input=kwargs.get("inputs"),
cost_details={"total": 0},
).end()

except Exception as e:
Expand Down Expand Up @@ -913,6 +916,7 @@ def on_llm_error(
status_message=str(error),
level="ERROR",
input=kwargs.get("inputs"),
cost_details={"total": 0},
).end()

except Exception as e:
Expand Down
Loading