Skip to content

Commit

Permalink
feat(controllers): add '/apps/workflow-config'
Browse files Browse the repository at this point in the history
Signed-off-by: -LAN- <[email protected]>
  • Loading branch information
laipz8200 committed Dec 8, 2024
1 parent 10336d1 commit db51210
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions api/controllers/console/app/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from werkzeug.exceptions import Forbidden, InternalServerError, NotFound

import services
from configs import dify_config
from controllers.console import api
from controllers.console.app.error import ConversationCompletedError, DraftWorkflowNotExist, DraftWorkflowNotSync
from controllers.console.app.wraps import get_app_model
Expand Down Expand Up @@ -426,6 +427,19 @@ def post(self, app_model: App):
}


class WorkflowConfigApi(Resource):
"""Resource for workflow configuration."""

@setup_required
@login_required
@account_initialization_required
def get(self):
"""Get workflow configuration limits."""
return {
"parallel_depth_limit": dify_config.WORKFLOW_PARALLEL_DEPTH_LIMIT,
}


api.add_resource(DraftWorkflowApi, "/apps/<uuid:app_id>/workflows/draft")
api.add_resource(AdvancedChatDraftWorkflowRunApi, "/apps/<uuid:app_id>/advanced-chat/workflows/draft/run")
api.add_resource(DraftWorkflowRunApi, "/apps/<uuid:app_id>/workflows/draft/run")
Expand All @@ -444,3 +458,4 @@ def post(self, app_model: App):
DefaultBlockConfigApi, "/apps/<uuid:app_id>/workflows/default-workflow-block-configs/<string:block_type>"
)
api.add_resource(ConvertToWorkflowApi, "/apps/<uuid:app_id>/convert-to-workflow")
api.add_resource(WorkflowConfigApi, "/apps/workflow-config", endpoint="workflow_config")

0 comments on commit db51210

Please sign in to comment.