Skip to content

Commit

Permalink
fix image
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrayraykk committed Sep 18, 2024
1 parent 3b302ae commit dacd09e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/agentscope/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ def _guess_type_by_extension(
url: str,
) -> Literal["image", "audio", "video", "file"]:
"""Guess the type of the file by its extension."""
extension = url.split(".")[-1].lower()
parsed_url = urlparse(url)
path = parsed_url.path
extension = path.split(".")[-1].lower() if "." in path else ""

if extension in [
"bmp",
Expand Down

0 comments on commit dacd09e

Please sign in to comment.