chore(file_manager): Reformat

Signed-off-by: -LAN- <laipz8200@outlook.com>
pull/22704/head
-LAN- 7 months ago
parent f7a0e71abd
commit ed1ea5129b
No known key found for this signature in database
GPG Key ID: 6BA0D108DED011FF

@ -47,21 +47,21 @@ def to_prompt_message_content(
) -> PromptMessageContentUnionTypes:
"""
Convert a file to prompt message content.
This function converts files to their appropriate prompt message content types.
For supported file types (IMAGE, AUDIO, VIDEO, DOCUMENT), it creates the
For supported file types (IMAGE, AUDIO, VIDEO, DOCUMENT), it creates the
corresponding message content with proper encoding/URL.
For unsupported file types, instead of raising an error, it returns a
For unsupported file types, instead of raising an error, it returns a
TextPromptMessageContent with a descriptive message about the file.
Args:
f: The file to convert
image_detail_config: Optional detail configuration for image files
Returns:
PromptMessageContentUnionTypes: The appropriate message content type
Raises:
ValueError: If file extension or mime_type is missing
"""
@ -80,9 +80,7 @@ def to_prompt_message_content(
# Check if file type is supported
if f.type not in prompt_class_map:
# For unsupported file types, return a text description
return TextPromptMessageContent(
data=f"[Unsupported file type: {f.filename} ({f.type.value})]"
)
return TextPromptMessageContent(data=f"[Unsupported file type: {f.filename} ({f.type.value})]")
# Process supported file types
params = {

Loading…
Cancel
Save