Skip to content

Commit

Permalink
style: fixed ruff errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonfish568 committed Jan 2, 2025
1 parent f9c86a1 commit a7d85c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions api/controllers/service_api/app/annotation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from flask import request
from flask_restful import Resource, marshal, marshal_with, reqparse # type: ignore
from werkzeug.exceptions import Forbidden
Expand Down Expand Up @@ -30,6 +29,7 @@ def post(self, app_model: App, end_user: EndUser, action):
raise ValueError("Unsupported annotation reply action")
return result, 200


class AnnotationReplyActionStatusApi(Resource):
@validate_app_token(fetch_user_arg=FetchUserArg(fetch_from=WhereisUserArg.QUERY))
def get(self, app_model: App, end_user: EndUser, job_id, action):
Expand Down Expand Up @@ -106,4 +106,4 @@ def delete(self, app_model: App, end_user: EndUser, annotation_id):
AnnotationReplyActionStatusApi, "/apps/annotation-reply/<string:action>/status/<uuid:job_id>"
)
api.add_resource(AnnotationListApi, "/apps/annotations")
api.add_resource(AnnotationUpdateDeleteApi, "/apps/annotations/<uuid:annotation_id>")
api.add_resource(AnnotationUpdateDeleteApi, "/apps/annotations/<uuid:annotation_id>")
8 changes: 3 additions & 5 deletions api/controllers/service_api/workspace/models.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import logging

from flask_login import current_user # type: ignore
from flask_restful import Resource, reqparse # type: ignore
from werkzeug.exceptions import Forbidden

from flask_restful import Resource # type: ignore
from controllers.service_api import api
from controllers.service_api.wraps import validate_dataset_token
from core.model_runtime.utils.encoders import jsonable_encoder
from services.model_provider_service import ModelProviderService


class ModelProviderAvailableModelApi(Resource):
@validate_dataset_token
def get(self, _, model_type):
Expand All @@ -19,4 +16,5 @@ def get(self, _, model_type):

return jsonable_encoder({"data": models})


api.add_resource(ModelProviderAvailableModelApi, "/workspaces/current/models/model-types/<string:model_type>")

0 comments on commit a7d85c2

Please sign in to comment.