mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-11 22:51:28 +00:00
Fix Langfuse callback skipping for Anthropic streaming passthrough
Fixes #17476 When using Anthropic pass-through endpoints with streaming and Langfuse callbacks, streaming requests were completing successfully but failing to log to Langfuse. Non-streaming requests worked correctly. Root cause: - _handle_logging_anthropic_collected_chunks() successfully builds the complete response from chunks - However, kwargs only included response_cost and model, missing the complete_streaming_response key - In litellm_logging.py, Langfuse callback checks for complete_streaming_response and skips logging when None Solution: - Add complete_streaming_response to kwargs dict before returning - This ensures callbacks like Langfuse can access the complete response and properly log streaming requests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5610945830
commit
8d2413f33f
1 changed files with 3 additions and 0 deletions
|
|
@ -218,6 +218,9 @@ class AnthropicPassthroughLoggingHandler:
|
|||
logging_obj=litellm_logging_obj,
|
||||
)
|
||||
|
||||
# Add complete_streaming_response to kwargs so callbacks like Langfuse can access it
|
||||
kwargs["complete_streaming_response"] = complete_streaming_response
|
||||
|
||||
return {
|
||||
"result": complete_streaming_response,
|
||||
"kwargs": kwargs,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue