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 application call #541

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

qbc2016
Copy link
Collaborator

@qbc2016 qbc2016 commented Feb 26, 2025

Description

As the title says.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@rayrayraykk
Copy link
Collaborator

rayrayraykk commented Feb 27, 2025

Please add a test in TestDashScopeChatWrapper and be careful with the dashscope version. Since the built bailian workflow handles query and historyList separately, we should not use the model.format to change the model input.

The other part looks good to me.

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.

Does application api support streaming mode here?

Others please see inline comments

@qbc2016
Copy link
Collaborator Author

qbc2016 commented Feb 27, 2025

Does application api support streaming mode here?

Others please see inline comments

yes, it supports streaming mode, and its activation is compatible with the parameter "stream": True in model_configs, I have modified the generation() function to support it.

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

@@ -124,6 +125,8 @@ def __init__(
self,
config_name: str,
model_name: str = None,
app_id: str = None,
api_type: Literal["generation", "application"] = "generation",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update the docstrings so that developers can know how to use this class as a model or application wrapper.

@@ -398,6 +428,32 @@ def format(
`List[dict]`:
The formatted messages.
"""
if self.api_type == "application":
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the requirement of the application api? Is it the same with the generation API?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It requires the parameter app_id instead of model. Besides, there are only minor differences, such as not supporting the plugins parameter, etc.

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.

3 participants