mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
test(base_utils): cover an empty system message inside a block-content run
Codecov flagged the empty-string branch of _text_blocks as the one line the PR left uncovered. The existing empty-string test only hits the plain-text join; this one forces the block path by merging an empty system message with a developer message that carries list content.
This commit is contained in:
parent
20b3f1efed
commit
69fd884493
1 changed files with 11 additions and 0 deletions
|
|
@ -99,6 +99,17 @@ class TestHoistDeveloperMessagesIntoLeadingSystemMessage:
|
|||
)
|
||||
) == [{"role": "system", "content": "Rules"}]
|
||||
|
||||
def test_empty_string_message_adds_no_block_when_the_run_merges_as_blocks(self):
|
||||
messages = [
|
||||
{"role": "system", "content": ""},
|
||||
{"role": "developer", "content": [{"type": "text", "text": "Rules"}]},
|
||||
{"role": "user", "content": "Hi"},
|
||||
]
|
||||
assert list(hoist_developer_messages_into_leading_system_message(messages)) == [
|
||||
{"role": "system", "content": [{"type": "text", "text": "Rules"}]},
|
||||
{"role": "user", "content": "Hi"},
|
||||
]
|
||||
|
||||
def test_two_cached_string_messages_keep_one_breakpoint_each(self):
|
||||
messages = [
|
||||
{"role": "system", "content": "A", "cache_control": {"type": "ephemeral", "ttl": "5m"}},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue