Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update dashscope version requirement
Browse files Browse the repository at this point in the history
cmgzn committed Nov 5, 2024
1 parent 1d0373b commit 353c621
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
@@ -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 = [
10 changes: 9 additions & 1 deletion src/agentscope/models/dashscope_model.py
Original file line number Diff line number Diff line change
@@ -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
@@ -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 {}
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/agentscope/web/gradio/utils.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 353c621

Please sign in to comment.