Skip to content

Commit

Permalink
Update dashscope version requirement (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgzn authored Nov 5, 2024
1 parent 1d0373b commit f60d4c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"scipy",
# Leaving openai and dashscope here as default supports
"openai>=1.3.0",
"dashscope==1.14.1",
"dashscope>=1.19.0",
]

extra_service_requires = [
Expand Down
10 changes: 9 additions & 1 deletion src/agentscope/models/dashscope_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@

try:
import dashscope

dashscope_version = dashscope.version.__version__
if dashscope_version < "1.19.0":
logger.warning(
f"You are using 'dashscope' version {dashscope_version}, "
"which is below the recommended version 1.19.0. "
"Please consider upgrading to maintain compatibility.",
)
from dashscope.api_entities.dashscope_response import GenerationResponse
except ImportError:
dashscope = None
Expand Down Expand Up @@ -54,7 +62,7 @@ def __init__(
if dashscope is None:
raise ImportError(
"The package 'dashscope' is not installed. Please install it "
"by running `pip install dashscope==1.14.1`",
"by running `pip install dashscope>=1.19.0`",
)

self.generate_args = generate_args or {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def dashscope_text_to_audio(
except ImportError as e:
raise ImportError(
"The package 'dashscope' is not installed. Please install it by "
"running `pip install dashscope==1.14.1`",
"running `pip install dashscope>=1.19.0`",
) from e

dashscope.api_key = api_key
Expand Down
2 changes: 1 addition & 1 deletion src/agentscope/web/gradio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def audio2text(audio_path: str) -> str:
except ImportError as e:
raise ImportError(
"The package dashscope is not found. Please install it by "
"running `pip install dashscope==1.14.1`",
"running `pip install dashscope>=1.19.0`",
) from e

callback = RecognitionCallback()
Expand Down

0 comments on commit f60d4c2

Please sign in to comment.