|
3 | 3 | from libs.external_api import ExternalApi
|
4 | 4 |
|
5 | 5 | from .app.app_import import AppImportApi, AppImportConfirmApi
|
| 6 | +from .explore.audio import ChatAudioApi, ChatTextApi |
| 7 | +from .explore.completion import ChatApi, ChatStopApi, CompletionApi, CompletionStopApi |
| 8 | +from .explore.conversation import ( |
| 9 | + ConversationApi, |
| 10 | + ConversationListApi, |
| 11 | + ConversationPinApi, |
| 12 | + ConversationRenameApi, |
| 13 | + ConversationUnPinApi, |
| 14 | +) |
| 15 | +from .explore.message import ( |
| 16 | + MessageFeedbackApi, |
| 17 | + MessageListApi, |
| 18 | + MessageMoreLikeThisApi, |
| 19 | + MessageSuggestedQuestionApi, |
| 20 | +) |
| 21 | +from .explore.workflow import ( |
| 22 | + InstalledAppWorkflowRunApi, |
| 23 | + InstalledAppWorkflowTaskStopApi, |
| 24 | +) |
6 | 25 | from .files import FileApi, FilePreviewApi, FileSupportTypeApi
|
7 | 26 | from .remote_files import RemoteFileInfoApi, RemoteFileUploadApi
|
8 | 27 |
|
|
66 | 85 |
|
67 | 86 | # Import explore controllers
|
68 | 87 | from .explore import (
|
69 |
| - audio, |
70 |
| - completion, |
71 |
| - conversation, |
72 | 88 | installed_app,
|
73 |
| - message, |
74 | 89 | parameter,
|
75 | 90 | recommended_app,
|
76 | 91 | saved_message,
|
77 |
| - workflow, |
| 92 | +) |
| 93 | + |
| 94 | +# Explore Audio |
| 95 | +api.add_resource(ChatAudioApi, "/installed-apps/<uuid:installed_app_id>/audio-to-text", endpoint="installed_app_audio") |
| 96 | +api.add_resource(ChatTextApi, "/installed-apps/<uuid:installed_app_id>/text-to-audio", endpoint="installed_app_text") |
| 97 | + |
| 98 | +# Explore Completion |
| 99 | +api.add_resource( |
| 100 | + CompletionApi, "/installed-apps/<uuid:installed_app_id>/completion-messages", endpoint="installed_app_completion" |
| 101 | +) |
| 102 | +api.add_resource( |
| 103 | + CompletionStopApi, |
| 104 | + "/installed-apps/<uuid:installed_app_id>/completion-messages/<string:task_id>/stop", |
| 105 | + endpoint="installed_app_stop_completion", |
| 106 | +) |
| 107 | +api.add_resource( |
| 108 | + ChatApi, "/installed-apps/<uuid:installed_app_id>/chat-messages", endpoint="installed_app_chat_completion" |
| 109 | +) |
| 110 | +api.add_resource( |
| 111 | + ChatStopApi, |
| 112 | + "/installed-apps/<uuid:installed_app_id>/chat-messages/<string:task_id>/stop", |
| 113 | + endpoint="installed_app_stop_chat_completion", |
| 114 | +) |
| 115 | + |
| 116 | +# Explore Conversation |
| 117 | +api.add_resource( |
| 118 | + ConversationRenameApi, |
| 119 | + "/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>/name", |
| 120 | + endpoint="installed_app_conversation_rename", |
| 121 | +) |
| 122 | +api.add_resource( |
| 123 | + ConversationListApi, "/installed-apps/<uuid:installed_app_id>/conversations", endpoint="installed_app_conversations" |
| 124 | +) |
| 125 | +api.add_resource( |
| 126 | + ConversationApi, |
| 127 | + "/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>", |
| 128 | + endpoint="installed_app_conversation", |
| 129 | +) |
| 130 | +api.add_resource( |
| 131 | + ConversationPinApi, |
| 132 | + "/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>/pin", |
| 133 | + endpoint="installed_app_conversation_pin", |
| 134 | +) |
| 135 | +api.add_resource( |
| 136 | + ConversationUnPinApi, |
| 137 | + "/installed-apps/<uuid:installed_app_id>/conversations/<uuid:c_id>/unpin", |
| 138 | + endpoint="installed_app_conversation_unpin", |
| 139 | +) |
| 140 | + |
| 141 | + |
| 142 | +# Explore Message |
| 143 | +api.add_resource(MessageListApi, "/installed-apps/<uuid:installed_app_id>/messages", endpoint="installed_app_messages") |
| 144 | +api.add_resource( |
| 145 | + MessageFeedbackApi, |
| 146 | + "/installed-apps/<uuid:installed_app_id>/messages/<uuid:message_id>/feedbacks", |
| 147 | + endpoint="installed_app_message_feedback", |
| 148 | +) |
| 149 | +api.add_resource( |
| 150 | + MessageMoreLikeThisApi, |
| 151 | + "/installed-apps/<uuid:installed_app_id>/messages/<uuid:message_id>/more-like-this", |
| 152 | + endpoint="installed_app_more_like_this", |
| 153 | +) |
| 154 | +api.add_resource( |
| 155 | + MessageSuggestedQuestionApi, |
| 156 | + "/installed-apps/<uuid:installed_app_id>/messages/<uuid:message_id>/suggested-questions", |
| 157 | + endpoint="installed_app_suggested_question", |
| 158 | +) |
| 159 | +# Explore Workflow |
| 160 | +api.add_resource(InstalledAppWorkflowRunApi, "/installed-apps/<uuid:installed_app_id>/workflows/run") |
| 161 | +api.add_resource( |
| 162 | + InstalledAppWorkflowTaskStopApi, "/installed-apps/<uuid:installed_app_id>/workflows/tasks/<string:task_id>/stop" |
78 | 163 | )
|
79 | 164 |
|
80 | 165 | # Import tag controllers
|
|
0 commit comments