mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
test(deepseek): pin tool result image carrier placement before a following turn
This commit is contained in:
parent
ca3ade45e0
commit
f173bbda2e
1 changed files with 14 additions and 0 deletions
|
|
@ -182,6 +182,20 @@ class TestDeepSeekVisionMultimodalContent:
|
|||
assert image_carrier["role"] == "user"
|
||||
assert image_block in image_carrier["content"]
|
||||
|
||||
def test_tool_result_image_carrier_placed_directly_after_tool_result(self):
|
||||
for next_message in (
|
||||
{"role": "user", "content": "so what do you see?"},
|
||||
{"role": "assistant", "content": "I see an image."},
|
||||
):
|
||||
tool_message = {**self._image_message(role="tool"), "tool_call_id": "call_1"}
|
||||
image_block = tool_message["content"][1]
|
||||
|
||||
result = self.config._transform_messages([tool_message, next_message], model=self.VISION_MODEL)
|
||||
|
||||
assert [m["role"] for m in result] == ["tool", "user", next_message["role"]]
|
||||
assert image_block in result[1]["content"]
|
||||
assert result[2] == next_message
|
||||
|
||||
def test_audio_block_collapsed_even_on_vision_model(self):
|
||||
messages = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue