fix(types/utils.py): support openai 'file' message type

Closes https://github.com/BerriAI/litellm/issues/9365
This commit is contained in:
Krrish Dholakia 2025-03-19 23:13:51 -07:00
parent fe24b9d90b
commit 8ef9129556
2 changed files with 33 additions and 0 deletions

View file

@ -1094,6 +1094,26 @@ def test_is_base64_encoded_2():
[
([{"role": "user", "content": "hi"}], True),
([{"role": "user", "content": [{"type": "text", "text": "hi"}]}], True),
(
[
{
"role": "user",
"content": [
{
"type": "file",
"file": {
"file_id": "123",
"file_name": "test.txt",
"file_size": 100,
"file_type": "text/plain",
"file_url": "https://example.com/test.txt",
},
}
],
}
],
True,
),
(
[
{