Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Refactor: rename /chat_channels to /chat-channels (#16099)

Wang Qi8067e97f0d26
diff --git a/api/apps/restful_apis/chat_channel_api.py b/api/apps/restful_apis/chat_channel_api.py
index 281ec8d098..f39a2597e2 100644
--- a/api/apps/restful_apis/chat_channel_api.py
+++ b/api/apps/restful_apis/chat_channel_api.py
@@ -31,7 +31,7 @@ def _chat_channel_auth_error(channel_id: str, user_id: str):
return get_json_result(data=False, message="No authorization.", code=RetCode.AUTHENTICATION_ERROR)
[email protected]("/chat_channels", methods=["POST"]) # noqa: F821
[email protected]("/chat-channels", methods=["POST"]) # noqa: F821
@login_required
@validate_request("name", "channel", "config")
async def create_chat_channel():
@@ -53,14 +53,14 @@ async def create_chat_channel():
return get_json_result(data=conn.to_dict())
[email protected]("/chat_channels", methods=["GET"]) # noqa: F821
[email protected]("/chat-channels", methods=["GET"]) # noqa: F821
@login_required
def list_chat_channel():
"""List chat channel bots owned by the current tenant."""
return get_json_result(data=ChatChannelService.list(current_user.id))
[email protected]("/chat_channels/<channel_id>", methods=["GET"]) # noqa: F821
[email protected]("/chat-channels/<channel_id>", methods=["GET"]) # noqa: F821
@login_required
def get_chat_channel(channel_id):
"""Return a chat channel bot's details when the current user can access it."""
@@ -73,7 +73,7 @@ def get_chat_channel(channel_id):
return get_json_result(data=conn.to_dict())
[email protected]("/chat_channels/<channel_id>", methods=["PATCH"]) # noqa: F821
[email protected]("/chat-channels/<channel_id>", methods=["PATCH"]) # noqa: F821
@login_required
async def update_chat_channel(channel_id):
"""Update an accessible chat channel bot's name/config/status."""
@@ -106,7 +106,7 @@ async def update_chat_channel(channel_id):
return get_json_result(data=conn.to_dict())
[email protected]("/chat_channels/<channel_id>", methods=["DELETE"]) # noqa: F821
[email protected]("/chat-channels/<channel_id>", methods=["DELETE"]) # noqa: F821
@login_required
def rm_chat_channel(channel_id):
"""Delete an accessible chat channel bot."""
diff --git a/web/src/utils/api.ts b/web/src/utils/api.ts
index 4132249a07..d0786396e2 100644
--- a/web/src/utils/api.ts
+++ b/web/src/utils/api.ts
@@ -97,11 +97,11 @@ export default {
boxWebAuthResult: () => `${restAPIv1}/connectors/box/oauth/web/result`,
// chat channel
- chatChannelSet: `${restAPIv1}/chat_channels`,
- chatChannelList: `${restAPIv1}/chat_channels`,
- chatChannelDetail: (id: string) => `${restAPIv1}/chat_channels/${id}`,
- chatChannelUpdate: (id: string) => `${restAPIv1}/chat_channels/${id}`,
- chatChannelDel: (id: string) => `${restAPIv1}/chat_channels/${id}`,
+ chatChannelSet: `${restAPIv1}/chat-channels`,
+ chatChannelList: `${restAPIv1}/chat-channels`,
+ chatChannelDetail: (id: string) => `${restAPIv1}/chat-channels/${id}`,
+ chatChannelUpdate: (id: string) => `${restAPIv1}/chat-channels/${id}`,
+ chatChannelDel: (id: string) => `${restAPIv1}/chat-channels/${id}`,
// plugin
llmTools: `${restAPIv1}/plugin/tools`,