Skip to content

Commit e739de5

Browse files
committed
refactor(file): comment out MIME type validation to allow for broader MIME type acceptance in file handling
1 parent 50fce9f commit e739de5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

agentle/generations/models/message_parts/file.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ def _validate_mime_type(self) -> None:
184184
# Also include common types that might not be in types_map
185185
all_mimes.update(mimetypes.common_types.values())
186186

187-
if self.mime_type not in all_mimes:
188-
raise ValueError(
189-
f"The provided MIME type '{self.mime_type}' is not in the list of official MIME types."
190-
)
187+
# if self.mime_type not in all_mimes:
188+
# raise ValueError(
189+
# f"The provided MIME type '{self.mime_type}' is not in the list of official MIME types."
190+
# )
191191

192192
def _validate_data_integrity(self) -> None:
193193
"""Validates that the data is well-formed for its claimed MIME type."""

examples/providers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ def add_numbers(a: float, b: float) -> float:
2727
)
2828

2929
example_file = FilePart.from_local_file(
30-
"/Users/arthurbrenno/Documents/Dev/Paragon/agentle/examples/dog.jpeg",
31-
"image/jpeg",
30+
"/Users/arthurbrenno/Documents/Dev/Paragon/agentle/examples/harvard.wav",
31+
"audio/mp3",
3232
)
3333

3434
# Run the Google agent
3535
generation = provider.generate(
36-
model="openai/gpt-oss-120b",
36+
model="google/gemini-2.5-flash",
3737
messages=[
3838
UserMessage(
3939
parts=[
4040
example_file,
4141
TextPart(
42-
text="O que essa imagem representa?",
42+
text="O que tem nesse audio?",
4343
),
4444
]
4545
)

0 commit comments

Comments
 (0)