Files
litellm/tests
Jay GowdyandGitHub 85d577c8e6 Fix: Handle dict objects in Anthropic streaming response (#11032)
* fix: handle dict objects in Anthropic streaming response

Fix issue where dictionary objects in Anthropic streaming responses
were not properly converted to SSE format strings before being yielded,
causing AttributeError: 'dict' object has no attribute 'encode'

* fix: refactor Anthropic streaming response handling

- Added STREAM_SSE_DATA_PREFIX constant in constants.py
- Created return_anthropic_chunk helper function for better maintainability
- Using safe_dumps from safe_json_dumps.py for improved JSON serialization
- Added unit test for dictionary object handling in streaming response

* fix: correct patch path in anthropic_endpoints test
2025-05-21 20:58:11 -07:00
..
2025-03-29 18:34:58 -07:00
2025-05-19 21:21:44 -07:00
2025-05-09 11:59:13 -07:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/litellm

This folder can only run mock tests.