Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 87461d1dac |
+20
-7
@@ -1,17 +1,20 @@
|
|||||||
"""外卖比价业务透传端点。
|
"""比价业务透传端点(外卖 + 电商两套)。
|
||||||
|
|
||||||
把客户端的 POST /api/v1/intent/recognize 和 /api/v1/price/step 请求原样转发给
|
把客户端的 POST /api/v1/{intent/recognize, price/step, ecom/intent/recognize, ecom/step}
|
||||||
pricebot-backend 的 /api/intent/recognize 和 /api/price/step。MVP 阶段**不鉴权**
|
请求原样转发给 pricebot-backend 的对应路径。MVP 阶段**不鉴权**(同 coupon/step,
|
||||||
(同 coupon/step,见 docs/待办与技术债.md P1:device_id 透传区分设备,待补 JWT +
|
见 docs/待办与技术债.md P1:device_id 透传区分设备,待补 JWT + device_id↔user_id
|
||||||
device_id↔user_id 绑定后才能做用户级画像)。
|
绑定后才能做用户级画像)。
|
||||||
|
|
||||||
|
外卖(food):
|
||||||
- Phase 1 /intent/recognize:从源平台(淘宝闪购/美团/京东外卖)购物车页识别店名+菜品+
|
- Phase 1 /intent/recognize:从源平台(淘宝闪购/美团/京东外卖)购物车页识别店名+菜品+
|
||||||
价格,一次性。
|
价格,一次性。
|
||||||
- Phase 2 /price/step:多轮循环,在目标平台复现订单读到手价,直到 done。
|
- Phase 2 /price/step:多轮循环,在目标平台复现订单读到手价,直到 done。
|
||||||
|
|
||||||
|
电商(ecom):
|
||||||
|
- Phase 1 /ecom/intent/recognize:从源平台(淘宝/抖音/拼多多)SKU+详情页识别商品,一次性。
|
||||||
|
- Phase 2 /ecom/step:多轮循环,在目标平台搜索商品并采价,直到 done。
|
||||||
|
|
||||||
真正的目标驱动比价逻辑在 pricebot-backend(GoalEngine,另一个 repo),本接口只是透传壳。
|
真正的目标驱动比价逻辑在 pricebot-backend(GoalEngine,另一个 repo),本接口只是透传壳。
|
||||||
电商(ecom)那两个端点 food MVP 暂不需要,以后放开 scene 时再加 /ecom/intent/recognize
|
|
||||||
和 /ecom/step 两行即可。
|
|
||||||
|
|
||||||
pricebot 协议文档:
|
pricebot 协议文档:
|
||||||
pricebot-backend/docs/main/02_api_protocol.md
|
pricebot-backend/docs/main/02_api_protocol.md
|
||||||
@@ -86,3 +89,13 @@ async def intent_recognize(request: Request) -> dict[str, Any]:
|
|||||||
@router.post("/price/step", summary="外卖比价 Phase 2 步进 (透传到 pricebot)")
|
@router.post("/price/step", summary="外卖比价 Phase 2 步进 (透传到 pricebot)")
|
||||||
async def price_step(request: Request) -> dict[str, Any]:
|
async def price_step(request: Request) -> dict[str, Any]:
|
||||||
return await _passthrough(request, "/api/price/step")
|
return await _passthrough(request, "/api/price/step")
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/ecom/intent/recognize", summary="电商比价 Phase 1 意图识别 (透传到 pricebot)")
|
||||||
|
async def ecom_intent_recognize(request: Request) -> dict[str, Any]:
|
||||||
|
return await _passthrough(request, "/api/ecom/intent/recognize")
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/ecom/step", summary="电商比价 Phase 2 步进 (透传到 pricebot)")
|
||||||
|
async def ecom_step(request: Request) -> dict[str, Any]:
|
||||||
|
return await _passthrough(request, "/api/ecom/step")
|
||||||
|
|||||||
Reference in New Issue
Block a user