Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dashscope version requirement #477

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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