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
2 changes: 2 additions & 0 deletions langfuse/langchain/CallbackHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,8 @@ def _parse_usage_model(usage: typing.Union[pydantic.BaseModel, dict]):
"token_count"
]

usage_model = {k: v for k, v in usage_model.items() if not isinstance(v, str)}

return usage_model if usage_model else None


Expand Down
1 change: 1 addition & 0 deletions tests/test_extract_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def test_models(expected_model: str, model: Any):


# all models here need to be tested here because we take the model from the kwargs / invocation_params or we need to make an actual call for setup
@pytest.mark.skip("Flaky")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skipped test marked as flaky. Consider referencing an issue or ticket to track fixing the flakiness instead of permanently skipping.

Suggested change
@pytest.mark.skip("Flaky")
@pytest.mark.skip("Flaky, see issue #1234")

@pytest.mark.parametrize(
"expected_model,model",
[
Expand Down
Loading