Before Order
Description
開始點餐前。
Resource
POST /v1/openai_scenario/before_order
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Request Body Parameters
| Name | Type | Description |
|---|---|---|
| message | string | 用戶輸入 |
| recommand | list[Recommand] | 當前推薦商品 |
Request Body Parameters Recommand
| Name | Type | Description |
|---|---|---|
| product_id | string | 商品代碼 |
| product_name | string | 商品名稱 (翻譯名稱) |
Request Example
{
"message": "用戶輸入文本",
"recommand": [{
"product_id": "H001",
"product_name": "蜂蜜啤酒"
}]
}
Response Body Parameters
| Name | Type | Description |
|---|---|---|
| intent | string | 意圖
|
| product_id | string | 商品代碼 |
| original_language | string | 原始語言 |
| quantity | int | 數量 |
| error_type | string | 錯誤類型
|
| error | string | 錯誤訊息 (此資訊僅會在OPENAI回傳錯誤格式出現) |
Response Example
Status-Code: 200
{
"intent": "agree_recommend",
"item_code": "H001",
"original_language": "zh",
"quantity": 1
}