Skip to content

Commit

Permalink
Merge branch 'feat/workflow-backend' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
takatost committed Mar 16, 2024
2 parents 6a91c56 + c709e33 commit d82f169
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
'HOSTED_ANTHROPIC_PAID_ENABLED': 'False',
'HOSTED_MODERATION_ENABLED': 'False',
'HOSTED_MODERATION_PROVIDERS': '',
'HOSTED_EXPOSE_APP_TEMPLATES': 'False',
'CLEAN_DAY_SETTING': 30,
'UPLOAD_FILE_SIZE_LIMIT': 15,
'UPLOAD_FILE_BATCH_LIMIT': 5,
Expand Down Expand Up @@ -290,6 +291,8 @@ def __init__(self):
self.HOSTED_MODERATION_ENABLED = get_bool_env('HOSTED_MODERATION_ENABLED')
self.HOSTED_MODERATION_PROVIDERS = get_env('HOSTED_MODERATION_PROVIDERS')

self.HOSTED_EXPOSE_APP_TEMPLATES = get_bool_env('HOSTED_EXPOSE_APP_TEMPLATES')

self.ETL_TYPE = get_env('ETL_TYPE')
self.UNSTRUCTURED_API_URL = get_env('UNSTRUCTURED_API_URL')
self.BILLING_ENABLED = get_bool_env('BILLING_ENABLED')
Expand Down
6 changes: 6 additions & 0 deletions api/controllers/console/explore/recommended_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from constants.languages import languages
from controllers.console import api
from controllers.console.app.error import AppNotFoundError
from controllers.console.wraps import account_initialization_required
from extensions.ext_database import db
from libs.login import login_required
from models.model import App, RecommendedApp
from services.app_service import AppService

Expand Down Expand Up @@ -34,6 +36,8 @@


class RecommendedAppListApi(Resource):
@login_required
@account_initialization_required
@marshal_with(recommended_app_list_fields)
def get(self):
# language args
Expand Down Expand Up @@ -83,6 +87,8 @@ def get(self):


class RecommendedAppApi(Resource):
@login_required
@account_initialization_required
def get(self, app_id):
app_id = str(app_id)

Expand Down
8 changes: 4 additions & 4 deletions api/controllers/console/explore/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
logger = logging.getLogger(__name__)


class WorkflowRunApi(InstalledAppResource):
class InstalledAppWorkflowRunApi(InstalledAppResource):
def post(self, installed_app: InstalledApp):
"""
Run workflow
Expand Down Expand Up @@ -64,7 +64,7 @@ def post(self, installed_app: InstalledApp):
raise InternalServerError()


class WorkflowTaskStopApi(InstalledAppResource):
class InstalledAppWorkflowTaskStopApi(InstalledAppResource):
def post(self, installed_app: InstalledApp, task_id: str):
"""
Stop workflow task
Expand All @@ -81,5 +81,5 @@ def post(self, installed_app: InstalledApp, task_id: str):
}


api.add_resource(WorkflowRunApi, '/installed-apps/<uuid:installed_app_id>/workflows/run')
api.add_resource(WorkflowTaskStopApi, '/installed-apps/<uuid:installed_app_id>/workflows/tasks/<string:task_id>/stop')
api.add_resource(InstalledAppWorkflowRunApi, '/installed-apps/<uuid:installed_app_id>/workflows/run')
api.add_resource(InstalledAppWorkflowTaskStopApi, '/installed-apps/<uuid:installed_app_id>/workflows/tasks/<string:task_id>/stop')

0 comments on commit d82f169

Please sign in to comment.