mirror of
https://github.com/YFGaia/dify-plus.git
synced 2026-06-04 10:14:00 +08:00
81dbfd6748
# Conflicts: # README.md # api/.env.example # api/controllers/console/__init__.py # api/controllers/console/apikey.py # api/controllers/console/explore/completion.py # api/controllers/console/explore/workflow.py # api/controllers/service_api/app/workflow.py # api/controllers/service_api/wraps.py # api/controllers/web/workflow.py # api/core/model_runtime/model_providers/bedrock/get_bedrock_client.py # api/core/model_runtime/model_providers/bedrock/llm/llm.py # api/core/model_runtime/model_providers/openai_api_compatible/openai_api_compatible.yaml # api/core/model_runtime/model_providers/openai_api_compatible/text_embedding/text_embedding.py # api/models/model.py # api/poetry.lock # api/pyproject.toml # web/.env.example # web/Dockerfile # web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout.tsx # web/app/components/app/overview/appCard.tsx # web/app/components/base/chat/chat-with-history/chat-wrapper.tsx # web/app/components/base/chat/embedded-chatbot/index.tsx # web/app/components/base/mermaid/index.tsx # web/app/components/develop/index.tsx # web/app/components/develop/secret-key/secret-key-modal.tsx # web/app/components/explore/app-list/index.tsx # web/app/components/explore/item-operation/index.tsx # web/app/components/explore/sidebar/app-nav-item/index.tsx # web/app/components/explore/sidebar/index.tsx # web/app/components/header/account-setting/index.tsx # web/app/components/header/index.tsx # web/app/components/share/text-generation/index.tsx # web/app/components/tools/provider/detail.tsx # web/app/layout.tsx # web/package.json # web/service/base.ts # web/yarn.lock
188 lines
5.6 KiB
Python
188 lines
5.6 KiB
Python
from flask import Blueprint
|
|
|
|
from libs.external_api import ExternalApi
|
|
|
|
from .app.app_import import AppImportApi, AppImportCheckDependenciesApi, AppImportConfirmApi
|
|
from .explore.audio import ChatAudioApi, ChatTextApi
|
|
from .explore.completion import ChatApi, ChatStopApi, CompletionApi, CompletionStopApi
|
|
from .explore.conversation import (
|
|
ConversationApi,
|
|
ConversationListApi,
|
|
ConversationPinApi,
|
|
ConversationRenameApi,
|
|
ConversationUnPinApi,
|
|
)
|
|
from .explore.message import (
|
|
MessageFeedbackApi,
|
|
MessageListApi,
|
|
MessageMoreLikeThisApi,
|
|
MessageSuggestedQuestionApi,
|
|
)
|
|
from .explore.workflow import (
|
|
InstalledAppWorkflowRunApi,
|
|
InstalledAppWorkflowTaskStopApi,
|
|
)
|
|
from .files import FileApi, FilePreviewApi, FileSupportTypeApi
|
|
from .remote_files import RemoteFileInfoApi, RemoteFileUploadApi
|
|
|
|
bp = Blueprint("console", __name__, url_prefix="/console/api")
|
|
api = ExternalApi(bp)
|
|
|
|
# File
|
|
api.add_resource(FileApi, "/files/upload")
|
|
api.add_resource(FilePreviewApi, "/files/<uuid:file_id>/preview")
|
|
api.add_resource(FileSupportTypeApi, "/files/support-type")
|
|
|
|
# Remote files
|
|
api.add_resource(RemoteFileInfoApi, "/remote-files/<path:url>")
|
|
api.add_resource(RemoteFileUploadApi, "/remote-files/upload")
|
|
|
|
# Import App
|
|
api.add_resource(AppImportApi, "/apps/imports")
|
|
api.add_resource(AppImportConfirmApi, "/apps/imports/<string:import_id>/confirm")
|
|
api.add_resource(AppImportCheckDependenciesApi, "/apps/imports/<string:app_id>/check-dependencies")
|
|
|
|
# Import other controllers
|
|
from . import admin, apikey, extension, feature, ping, setup, version
|
|
|
|
# Import app controllers
|
|
from .app import (
|
|
advanced_prompt_template,
|
|
agent,
|
|
annotation,
|
|
app,
|
|
app_extend, # 二开部分:新增同步应用到模版中心
|
|
audio,
|
|
completion,
|
|
conversation,
|
|
conversation_variables,
|
|
ding_talk_extend, # Extend: DingTalk Related APIs
|
|
generator,
|
|
message,
|
|
model_config,
|
|
ops_trace,
|
|
passport_extend, # 二开部分: 新增passport_extend(额度限制,应用web计费)
|
|
site,
|
|
statistic,
|
|
workflow,
|
|
workflow_app_log,
|
|
workflow_run,
|
|
workflow_statistic,
|
|
)
|
|
|
|
# Import auth controllers
|
|
from .auth import activate, data_source_bearer_auth, data_source_oauth, forgot_password, login, oauth, register_extend # 二开部分: 新增用户(调用dify注册接口)
|
|
|
|
# Import billing controllers
|
|
from .billing import billing, compliance
|
|
|
|
# Import datasets controllers
|
|
from .datasets import (
|
|
data_source,
|
|
datasets,
|
|
datasets_document,
|
|
datasets_segments,
|
|
external,
|
|
hit_testing,
|
|
metadata,
|
|
website,
|
|
)
|
|
|
|
# Import explore controllers
|
|
from .explore import (
|
|
installed_app,
|
|
parameter,
|
|
recommended_app,
|
|
saved_message,
|
|
)
|
|
|
|
# Explore Audio
|
|
api.add_resource(ChatAudioApi, "/installed-apps/<uuid:installed_app_id>/audio-to-text", endpoint="installed_app_audio")
|
|
api.add_resource(ChatTextApi, "/installed-apps/<uuid:installed_app_id>/text-to-audio", endpoint="installed_app_text")
|
|
|
|
# Explore Completion
|
|
api.add_resource(
|
|
CompletionApi, "/installed-apps/<uuid:installed_app_id>/completion-messages", endpoint="installed_app_completion"
|
|
)
|
|
api.add_resource(
|
|
CompletionStopApi,
|
|
"/installed-apps/<uuid:installed_app_id>/completion-messages/<string:task_id>/stop",
|
|
endpoint="installed_app_stop_completion",
|
|
)
|
|
api.add_resource(
|
|
ChatApi, "/installed-apps/<uuid:installed_app_id>/chat-messages", endpoint="installed_app_chat_completion"
|
|
)
|
|
api.add_resource(
|
|
ChatStopApi,
|
|
"/installed-apps/<uuid:installed_app_id>/chat-messages/<string:task_id>/stop",
|
|
endpoint="installed_app_stop_chat_completion",
|
|
)
|
|
|
|
# Explore Conversation
|
|
api.add_resource(
|
|
ConversationRenameApi,
|
|
"/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>/name",
|
|
endpoint="installed_app_conversation_rename",
|
|
)
|
|
api.add_resource(
|
|
ConversationListApi, "/installed-apps/<uuid:installed_app_id>/conversations", endpoint="installed_app_conversations"
|
|
)
|
|
api.add_resource(
|
|
ConversationApi,
|
|
"/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>",
|
|
endpoint="installed_app_conversation",
|
|
)
|
|
api.add_resource(
|
|
ConversationPinApi,
|
|
"/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>/pin",
|
|
endpoint="installed_app_conversation_pin",
|
|
)
|
|
api.add_resource(
|
|
ConversationUnPinApi,
|
|
"/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>/unpin",
|
|
endpoint="installed_app_conversation_unpin",
|
|
)
|
|
|
|
|
|
# Explore Message
|
|
api.add_resource(MessageListApi, "/installed-apps/<uuid:installed_app_id>/messages", endpoint="installed_app_messages")
|
|
api.add_resource(
|
|
MessageFeedbackApi,
|
|
"/installed-apps/<uuid:installed_app_id>/messages/<uuid:message_id>/feedbacks",
|
|
endpoint="installed_app_message_feedback",
|
|
)
|
|
api.add_resource(
|
|
MessageMoreLikeThisApi,
|
|
"/installed-apps/<uuid:installed_app_id>/messages/<uuid:message_id>/more-like-this",
|
|
endpoint="installed_app_more_like_this",
|
|
)
|
|
api.add_resource(
|
|
MessageSuggestedQuestionApi,
|
|
"/installed-apps/<uuid:installed_app_id>/messages/<uuid:message_id>/suggested-questions",
|
|
endpoint="installed_app_suggested_question",
|
|
)
|
|
# Explore Workflow
|
|
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"
|
|
)
|
|
|
|
# Import tag controllers
|
|
from .tag import tags
|
|
|
|
# Import workspace controllers
|
|
# 二开部分:新增account_extend
|
|
from .workspace import (
|
|
account,
|
|
account_extend,
|
|
agent_providers,
|
|
endpoint,
|
|
load_balancing_config,
|
|
members,
|
|
model_providers,
|
|
models,
|
|
plugin,
|
|
tool_providers,
|
|
workspace,
|
|
)
|