mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
test(anthropic): pin dropped file-id and empty-url document sources to string output
This commit is contained in:
parent
e1a0920445
commit
c3c9e3a919
1 changed files with 17 additions and 0 deletions
|
|
@ -1644,6 +1644,23 @@ class TestToolResultDocuments:
|
|||
output = self._tool_output(self._translate([{"type": "text", "text": "plain result"}]))
|
||||
assert output == "plain result"
|
||||
|
||||
def test_file_id_source_document_keeps_string_output(self):
|
||||
output = self._tool_output(
|
||||
self._translate(
|
||||
[
|
||||
{"type": "text", "text": "stub"},
|
||||
{"type": "document", "source": {"type": "file", "file_id": "file_abc123"}},
|
||||
]
|
||||
)
|
||||
)
|
||||
assert output == "stub"
|
||||
|
||||
def test_url_source_without_url_keeps_string_output(self):
|
||||
output = self._tool_output(
|
||||
self._translate([{"type": "text", "text": "stub"}, {"type": "document", "source": {"type": "url"}}])
|
||||
)
|
||||
assert output == "stub"
|
||||
|
||||
def test_text_image_and_document_mix(self):
|
||||
items = self._translate(
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue