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

Add DashScope API based multimodal service functions in AgentScope library #255

Merged
merged 11 commits into from
Jun 5, 2024

Conversation

PengHongyiNTU
Copy link
Contributor

This PR introduces three new services to the service toolkit: dashscope_text_to_image, dashscope_image_to_text, and dashscope_text_to_audio.

also fix a small error in examples/conversation_with_customized_services

@garyzhang99
Copy link
Collaborator

The title of this PR isn't quite accurate.

@PengHongyiNTU PengHongyiNTU changed the title fixing pre-commit errors dashscope_text_to_image, dashscope_image_to_text, and dashscope_text_to_audio. May 24, 2024
@PengHongyiNTU PengHongyiNTU changed the title dashscope_text_to_image, dashscope_image_to_text, and dashscope_text_to_audio. add dashscope_text_to_image, dashscope_image_to_text, and dashscope_text_to_audio to services May 24, 2024
@garyzhang99
Copy link
Collaborator

Although it might be a bit of a hassle, please consider adding corresponding tests for the new added service functions.
You may refer to the examples in tests/execute_python_code_test.py and tests/dashscope_test.py, utilizing mocks to simulate the return values of the relevant dashscope libraries. This way, if any bugs arise in the future due to changes in the library, we can quickly pinpoint them.

Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see inline comments.

src/agentscope/service/multi_modality/dash_scope.py Outdated Show resolved Hide resolved
src/agentscope/service/multi_modality/dash_scope.py Outdated Show resolved Hide resolved
src/agentscope/service/multi_modality/dash_scope.py Outdated Show resolved Hide resolved
src/agentscope/service/multi_modality/dash_scope.py Outdated Show resolved Hide resolved
src/agentscope/service/multi_modality/dash_scope.py Outdated Show resolved Hide resolved
@DavdGao DavdGao changed the title add dashscope_text_to_image, dashscope_image_to_text, and dashscope_text_to_audio to services Add DashScope API based multimodal service functions in AgentScope library May 24, 2024
Copy link
Collaborator

@xieyxclack xieyxclack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
BTM, it may be not convenient for users to have to pass the same api_key every time they use dashscope_xx_to_xx. Is it possible for users to set up an api_key with export api_key=xxx instead? @DavdGao

src/agentscope/service/multi_modality/dash_scope.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@PengHongyiNTU PengHongyiNTU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need modify test accordingly

Copy link
Collaborator

@DavdGao DavdGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DavdGao DavdGao merged commit 47f42b2 into modelscope:main Jun 5, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants