2023-05-15 08:51:32 +08:00
|
|
|
from flask import Blueprint
|
2024-04-18 20:24:05 +08:00
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
from libs.external_api import ExternalApi
|
|
|
|
|
2024-11-01 15:51:22 +08:00
|
|
|
from .files import FileApi, FilePreviewApi, FileSupportTypeApi
|
|
|
|
from .remote_files import RemoteFileInfoApi, RemoteFileUploadApi
|
|
|
|
|
2024-08-26 15:29:10 +08:00
|
|
|
bp = Blueprint("console", __name__, url_prefix="/console/api")
|
2023-05-15 08:51:32 +08:00
|
|
|
api = ExternalApi(bp)
|
|
|
|
|
2024-11-01 15:51:22 +08:00
|
|
|
# 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")
|
|
|
|
|
2023-05-25 15:54:45 +08:00
|
|
|
# Import other controllers
|
2024-04-18 20:24:05 +08:00
|
|
|
from . import admin, apikey, extension, feature, ping, setup, version
|
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
# Import app controllers
|
2024-04-18 20:24:05 +08:00
|
|
|
from .app import (
|
|
|
|
advanced_prompt_template,
|
|
|
|
agent,
|
|
|
|
annotation,
|
|
|
|
app,
|
|
|
|
audio,
|
|
|
|
completion,
|
|
|
|
conversation,
|
2024-08-13 14:44:10 +08:00
|
|
|
conversation_variables,
|
2024-04-18 20:24:05 +08:00
|
|
|
generator,
|
|
|
|
message,
|
|
|
|
model_config,
|
2024-06-26 17:33:29 +08:00
|
|
|
ops_trace,
|
2024-04-18 20:24:05 +08:00
|
|
|
site,
|
|
|
|
statistic,
|
|
|
|
workflow,
|
|
|
|
workflow_app_log,
|
|
|
|
workflow_run,
|
|
|
|
workflow_statistic,
|
|
|
|
)
|
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
# Import auth controllers
|
2024-07-05 13:38:51 +08:00
|
|
|
from .auth import activate, data_source_bearer_auth, data_source_oauth, forgot_password, login, oauth
|
2024-04-18 20:24:05 +08:00
|
|
|
|
2024-02-01 18:11:57 +08:00
|
|
|
# Import billing controllers
|
|
|
|
from .billing import billing
|
2024-04-18 20:24:05 +08:00
|
|
|
|
2023-05-15 08:51:32 +08:00
|
|
|
# Import datasets controllers
|
2024-09-30 15:38:43 +08:00
|
|
|
from .datasets import (
|
|
|
|
data_source,
|
|
|
|
datasets,
|
|
|
|
datasets_document,
|
|
|
|
datasets_segments,
|
|
|
|
external,
|
|
|
|
hit_testing,
|
|
|
|
website,
|
|
|
|
)
|
2024-04-18 20:24:05 +08:00
|
|
|
|
2023-05-25 15:54:45 +08:00
|
|
|
# Import explore controllers
|
2024-04-18 20:24:05 +08:00
|
|
|
from .explore import (
|
|
|
|
audio,
|
|
|
|
completion,
|
|
|
|
conversation,
|
|
|
|
installed_app,
|
|
|
|
message,
|
|
|
|
parameter,
|
|
|
|
recommended_app,
|
|
|
|
saved_message,
|
|
|
|
workflow,
|
|
|
|
)
|
|
|
|
|
2024-04-24 15:02:29 +08:00
|
|
|
# Import tag controllers
|
|
|
|
from .tag import tags
|
|
|
|
|
2024-01-12 12:34:01 +08:00
|
|
|
# Import workspace controllers
|
2024-06-05 00:13:04 +08:00
|
|
|
from .workspace import account, load_balancing_config, members, model_providers, models, tool_providers, workspace
|