From 87ed7b74868924230c5ae9848e1a26cb59fab415 Mon Sep 17 00:00:00 2001 From: xianze Date: Wed, 10 Jun 2026 19:22:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(compare):=20=E5=8A=A0=E7=BE=8E=E5=9B=A2?= =?UTF-8?q?=E6=AF=94=E4=BB=B7=E5=89=8D=E7=94=A8=E5=88=B8=E9=80=8F=E4=BC=A0?= =?UTF-8?q?=E7=AB=AF=E7=82=B9=20/intent/precoupon/step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 客户端在美团源比价的意图识别前先循环调本端点用券, 透传到 pricebot-backend 的 /api/intent/precoupon/step。同 /intent/step 透传壳: 不鉴权、不做 schema 校验。 Co-Authored-By: Claude Opus 4.8 (1M context) --- app/api/v1/compare.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/api/v1/compare.py b/app/api/v1/compare.py index 42bcddd..93279b3 100644 --- a/app/api/v1/compare.py +++ b/app/api/v1/compare.py @@ -102,6 +102,17 @@ async def intent_step(request: Request) -> dict[str, Any]: return await _passthrough(request, "/api/intent/step") +@router.post( + "/intent/precoupon/step", + summary="外卖比价 Phase 0 意图识别前先用券 (透传到 pricebot, 仅美团源)", +) +async def intent_precoupon_step(request: Request) -> dict[str, Any]: + # 美团源平台『意图识别前先用券』多帧循环: 客户端在调 /intent/recognize 之前先循环 + # 调本端点到 done(continue=false)。订单页底部有『点击使用X红包』就自动选最大免费券 + # 用上, 已用券/无券则首帧秒过。与 /intent/step 同属 intent 域, 复用同一透传壳。 + return await _passthrough(request, "/api/intent/precoupon/step") + + @router.post("/price/step", summary="外卖比价 Phase 2 步进 (透传到 pricebot)") async def price_step(request: Request) -> dict[str, Any]: return await _passthrough(request, "/api/price/step") -- 2.52.0