From 374e1901931d90f121ab561e3471630eba136628 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Dec 2024 18:39:28 +0800 Subject: [PATCH] Fix bug in checking local or remote file on Windows --- src/agentscope/utils/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agentscope/utils/common.py b/src/agentscope/utils/common.py index 372d9ca66..bfdadb4e8 100644 --- a/src/agentscope/utils/common.py +++ b/src/agentscope/utils/common.py @@ -295,7 +295,7 @@ def _to_openai_image_url(url: str) -> str: lower_url = url.lower() # Web url - if parsed_url.scheme != "": + if not os.path.exists(url) and parsed_url.scheme != "": if any(lower_url.endswith(_) for _ in support_image_extensions): return url