From 2706cfbb2f8e00bcbbf1ae252cece11442bb691b Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Wed, 5 Aug 2026 00:00:03 +0800 Subject: [PATCH] feat: add smartMatchAssets API for Q5 smart match simplify --- apps/web/src/api/assets/assets.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/web/src/api/assets/assets.ts b/apps/web/src/api/assets/assets.ts index 902aface1..7899c643f 100644 --- a/apps/web/src/api/assets/assets.ts +++ b/apps/web/src/api/assets/assets.ts @@ -49,6 +49,19 @@ export const getAssetsByKind = async ( return response.data.items || [] } +/** + * 智能匹配素材(后端 AI 选素材) + * 调用后端 smart-match 端点,由后端根据素材库内容智能选择素材 + */ +export const smartMatchAssets = async ( + libraryId: string, +): Promise<{ items: AssetItem[] }> => { + const response = await apiClient.post("/assets/smart-match", { + library_id: libraryId, + }) + return response.data +} + /** 创建素材(上传文件后调用,附带 metadata) */ export const createAsset = async (data: { library_id: string @@ -85,3 +98,4 @@ export const updateAssetReviewStatus = async ( export const deleteAsset = async (assetId: string): Promise => { await apiClient.delete(`/assets/${assetId}`) } +