Skip to content
Merged
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion langfuse/langchain/CallbackHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def _parse_usage_model(usage: typing.Union[pydantic.BaseModel, dict]) -> Any:
if "input" in usage_model:
usage_model["input"] = max(0, usage_model["input"] - value)

usage_model = {k: v for k, v in usage_model.items() if not isinstance(v, str)}
usage_model = {k: v for k, v in usage_model.items() if isinstance(v, int)}
Comment thread
hassiebp marked this conversation as resolved.
Comment thread
hassiebp marked this conversation as resolved.
Comment thread
hassiebp marked this conversation as resolved.

return usage_model if usage_model else None

Expand Down