Skip to content

Commit

Permalink
update (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrayraykk authored Nov 12, 2024
1 parent b078f03 commit 6c1674b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/agentscope/studio/tools/image_synthesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def image_synthesis(
if res.status == ServiceExecStatus.SUCCESS:
return Msg(
name="ImageSynthesis",
content=res.content,
content="Image synthesis succeed.",
url=res.content["image_urls"],
role="assistant",
echo=True,
Expand Down
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 6c1674b

Please sign in to comment.