From b7916227e236b6f0355b891d0fbd0af50fa83ff7 Mon Sep 17 00:00:00 2001 From: ytqh Date: Sun, 2 Mar 2025 13:26:50 +0800 Subject: [PATCH] change path --- .../service_api_with_auth/app/app.py | 6 +++--- .../service_api_with_auth/app/audio.py | 10 +++------- .../service_api_with_auth/app/completion.py | 20 ++++++------------- .../service_api_with_auth/app/conversation.py | 12 ++++------- .../service_api_with_auth/app/file.py | 8 ++------ .../service_api_with_auth/app/message.py | 12 ++++------- .../service_api_with_auth/app/workflow.py | 20 ++++++------------- 7 files changed, 28 insertions(+), 60 deletions(-) diff --git a/api/controllers/service_api_with_auth/app/app.py b/api/controllers/service_api_with_auth/app/app.py index f110a8eb92..7fe73d4f0c 100644 --- a/api/controllers/service_api_with_auth/app/app.py +++ b/api/controllers/service_api_with_auth/app/app.py @@ -17,7 +17,7 @@ class AppParameterApi(Resource): """Retrieve app parameters. --- tags: - - app/parameters + - service/parameters summary: Get app parameters description: Retrieve parameters for the current application security: @@ -61,7 +61,7 @@ class AppMetaApi(Resource): """Get app meta information. --- tags: - - app/meta + - service/meta summary: Get app meta description: Retrieve meta information for the current application security: @@ -83,7 +83,7 @@ class AppInfoApi(Resource): """Get app information. --- tags: - - app/info + - service/info summary: Get app info description: Retrieve basic information about the current application security: diff --git a/api/controllers/service_api_with_auth/app/audio.py b/api/controllers/service_api_with_auth/app/audio.py index b6bb979c68..03b6bbb2d3 100644 --- a/api/controllers/service_api_with_auth/app/audio.py +++ b/api/controllers/service_api_with_auth/app/audio.py @@ -14,11 +14,7 @@ from controllers.service_api_with_auth.app.error import ( UnsupportedAudioTypeError, ) from controllers.service_api_with_auth.wraps import validate_app_token -from core.errors.error import ( - ModelCurrentlyNotSupportError, - ProviderTokenNotInitError, - QuotaExceededError, -) +from core.errors.error import ModelCurrentlyNotSupportError, ProviderTokenNotInitError, QuotaExceededError from core.model_runtime.errors.invoke import InvokeError from flask import request from flask_restful import Resource, reqparse # type: ignore @@ -39,7 +35,7 @@ class AudioApi(Resource): """Transcribe audio to text. --- tags: - - app/audio + - service/audio summary: Transcribe audio description: Convert audio file to text using speech-to-text security: @@ -108,7 +104,7 @@ class TextApi(Resource): """Convert text to speech. --- tags: - - app/audio + - service/audio summary: Text to speech description: Convert text to speech audio security: diff --git a/api/controllers/service_api_with_auth/app/completion.py b/api/controllers/service_api_with_auth/app/completion.py index 69d9450915..df964cfd65 100644 --- a/api/controllers/service_api_with_auth/app/completion.py +++ b/api/controllers/service_api_with_auth/app/completion.py @@ -11,18 +11,10 @@ from controllers.service_api_with_auth.app.error import ( ProviderNotInitializeError, ProviderQuotaExceededError, ) -from controllers.service_api_with_auth.wraps import ( - FetchUserArg, - WhereisUserArg, - validate_app_token, -) +from controllers.service_api_with_auth.wraps import FetchUserArg, WhereisUserArg, validate_app_token from core.app.apps.base_app_queue_manager import AppQueueManager from core.app.entities.app_invoke_entities import InvokeFrom -from core.errors.error import ( - ModelCurrentlyNotSupportError, - ProviderTokenNotInitError, - QuotaExceededError, -) +from core.errors.error import ModelCurrentlyNotSupportError, ProviderTokenNotInitError, QuotaExceededError from core.model_runtime.errors.invoke import InvokeError from flask_restful import Resource, reqparse # type: ignore from libs import helper @@ -39,7 +31,7 @@ class CompletionApi(Resource): """Generate completion response. --- tags: - - app/completion + - service/completion summary: Generate completion description: Generate a completion response for the provided inputs security: @@ -134,7 +126,7 @@ class CompletionStopApi(Resource): """Stop a running completion task. --- tags: - - app/completion + - service/completion summary: Stop completion task description: Stop a running completion generation task security: @@ -173,7 +165,7 @@ class ChatApi(Resource): """Generate chat response. --- tags: - - app/chat + - service/chat summary: Generate chat response description: Generate a chat response for the provided inputs and query security: @@ -274,7 +266,7 @@ class ChatStopApi(Resource): """Stop a running chat task. --- tags: - - app/chat + - service/chat summary: Stop chat task description: Stop a running chat generation task security: diff --git a/api/controllers/service_api_with_auth/app/conversation.py b/api/controllers/service_api_with_auth/app/conversation.py index 5d3e5c7ce2..a652d62b99 100644 --- a/api/controllers/service_api_with_auth/app/conversation.py +++ b/api/controllers/service_api_with_auth/app/conversation.py @@ -1,11 +1,7 @@ import services from controllers.service_api_with_auth import api from controllers.service_api_with_auth.app.error import NotChatAppError -from controllers.service_api_with_auth.wraps import ( - FetchUserArg, - WhereisUserArg, - validate_app_token, -) +from controllers.service_api_with_auth.wraps import FetchUserArg, WhereisUserArg, validate_app_token from core.app.entities.app_invoke_entities import InvokeFrom from extensions.ext_database import db from fields.conversation_fields import ( @@ -29,7 +25,7 @@ class ConversationApi(Resource): """Get conversations list. --- tags: - - app/conversation + - service/conversation summary: List conversations description: Get a paginated list of conversations for the current user security: @@ -109,7 +105,7 @@ class ConversationDetailApi(Resource): """Delete a conversation. --- tags: - - app/conversation + - service/conversation summary: Delete conversation description: Delete a specific conversation security: @@ -155,7 +151,7 @@ class ConversationRenameApi(Resource): """Rename a conversation. --- tags: - - app/conversation + - service/conversation summary: Rename conversation description: Change the name of a specific conversation security: diff --git a/api/controllers/service_api_with_auth/app/file.py b/api/controllers/service_api_with_auth/app/file.py index 42f0d29d86..94c7e692b5 100644 --- a/api/controllers/service_api_with_auth/app/file.py +++ b/api/controllers/service_api_with_auth/app/file.py @@ -7,11 +7,7 @@ from controllers.service_api_with_auth.app.error import ( TooManyFilesError, UnsupportedFileTypeError, ) -from controllers.service_api_with_auth.wraps import ( - FetchUserArg, - WhereisUserArg, - validate_app_token, -) +from controllers.service_api_with_auth.wraps import FetchUserArg, WhereisUserArg, validate_app_token from fields.file_fields import file_fields from flask import request from flask_restful import Resource, marshal_with # type: ignore @@ -26,7 +22,7 @@ class FileApi(Resource): """Upload a file. --- tags: - - app/file + - service/file summary: Upload file description: Upload a file to be used with the application security: diff --git a/api/controllers/service_api_with_auth/app/message.py b/api/controllers/service_api_with_auth/app/message.py index a039adb990..1c66bd44a9 100644 --- a/api/controllers/service_api_with_auth/app/message.py +++ b/api/controllers/service_api_with_auth/app/message.py @@ -3,11 +3,7 @@ import logging import services from controllers.service_api_with_auth import api from controllers.service_api_with_auth.app.error import NotChatAppError -from controllers.service_api_with_auth.wraps import ( - FetchUserArg, - WhereisUserArg, - validate_app_token, -) +from controllers.service_api_with_auth.wraps import FetchUserArg, WhereisUserArg, validate_app_token from core.app.entities.app_invoke_entities import InvokeFrom from fields.conversation_fields import message_file_fields from fields.raws import FilesContainedField @@ -83,7 +79,7 @@ class MessageListApi(Resource): """Get messages list. --- tags: - - app/message + - service/message summary: List messages description: Get a paginated list of messages for a conversation security: @@ -154,7 +150,7 @@ class MessageFeedbackApi(Resource): """Submit feedback for a message. --- tags: - - app/message + - service/message summary: Submit message feedback description: Submit user feedback for a specific message security: @@ -224,7 +220,7 @@ class MessageSuggestedApi(Resource): """Get suggested questions for a message. --- tags: - - app/message + - service/message summary: Get suggested questions description: Get suggested follow-up questions for a specific message security: diff --git a/api/controllers/service_api_with_auth/app/workflow.py b/api/controllers/service_api_with_auth/app/workflow.py index 7c50da4841..7de44df751 100644 --- a/api/controllers/service_api_with_auth/app/workflow.py +++ b/api/controllers/service_api_with_auth/app/workflow.py @@ -8,18 +8,10 @@ from controllers.service_api_with_auth.app.error import ( ProviderNotInitializeError, ProviderQuotaExceededError, ) -from controllers.service_api_with_auth.wraps import ( - FetchUserArg, - WhereisUserArg, - validate_app_token, -) +from controllers.service_api_with_auth.wraps import FetchUserArg, WhereisUserArg, validate_app_token from core.app.apps.base_app_queue_manager import AppQueueManager from core.app.entities.app_invoke_entities import InvokeFrom -from core.errors.error import ( - ModelCurrentlyNotSupportError, - ProviderTokenNotInitError, - QuotaExceededError, -) +from core.errors.error import ModelCurrentlyNotSupportError, ProviderTokenNotInitError, QuotaExceededError from core.model_runtime.errors.invoke import InvokeError from extensions.ext_database import db from fields.workflow_app_log_fields import workflow_app_log_pagination_fields @@ -56,7 +48,7 @@ class WorkflowRunDetailApi(Resource): """Get workflow run details. --- tags: - - app/workflow + - service/workflow summary: Get workflow run details description: Retrieve details of a specific workflow run security: @@ -117,7 +109,7 @@ class WorkflowRunApi(Resource): """Run a workflow. --- tags: - - app/workflow + - service/workflow summary: Run workflow description: Execute a workflow with the provided inputs security: @@ -187,7 +179,7 @@ class WorkflowTaskStopApi(Resource): """Stop a running workflow task. --- tags: - - app/workflow + - service/workflow summary: Stop workflow task description: Stop a running workflow task security: @@ -228,7 +220,7 @@ class WorkflowAppLogApi(Resource): """Get workflow app logs. --- tags: - - app/workflow + - service/workflow summary: Get workflow logs description: Retrieve logs for workflow app executions security: