🐛 migrate langfuse v3 API to v4, remove type: ignore#151
Merged
Miyamura80 merged 2 commits intomainfrom Mar 30, 2026
Merged
Conversation
Langfuse v4 removed `.generation()` and `.span()` from the client and changed `.end()` to only accept `end_time`. Migrate to `start_observation()` with `as_type` and split `.end()` into `.update()` + `.end()`. Also tighten `current_tool_span` type from `Any` to `LangfuseSpan`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR migrates Key changes:
Confidence Score: 5/5
Important Files Changed
Reviews (2): Last reviewed commit: "🐛 address PR review feedback: use as_ty..." | Re-trigger Greptile |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.generation(),.span()) to v4start_observation()API withas_typeparameter.end()calls that passed kwargs no longer accepted in v4 — split into.update()+.end()TraceContextTypedDict for propertrace_id/parent_span_idhandlingcurrent_tool_spantype fromAny | NonetoLangfuseSpan | Nonetype: ignore[attr-defined]suppressions —make cipasses with zero errorsTest plan
make cipasses (ruff, vulture, ty, import lint, docs lint)🤖 Generated with Claude Code