新增 Lazada 渠道扩展,支持在 Yuxi 平台中集成 Lazada 电商客服渠道。 包含以下功能模块: - client: Lazada API 客户端封装 - config: 渠道配置管理 - gateway: SSE/WebSocket 网关接入 - webhook: Webhook 事件处理 - outbound: 外发消息管理 - pairing: 用户配对与绑定 - security: 安全校验 - signature: 请求签名验证 - dedupe: 消息去重 - monitor: 渠道状态监控 - status: 会话状态管理 - session: 会话管理 - tools: Agent 工具集成 - tools_config: 工具配置 - types: 类型定义
91 lines
3.0 KiB
Python
91 lines
3.0 KiB
Python
from __future__ import annotations
|
|
|
|
LAZADA_TOOLS_ENABLED = {
|
|
"order_query": True,
|
|
"product_query": True,
|
|
"logistics_query": True,
|
|
"session_list": True,
|
|
"message_history": True,
|
|
"orders_query": True,
|
|
"order_items_query": True,
|
|
"seller_query": True,
|
|
}
|
|
|
|
LAZADA_TOOL_DESCRIPTIONS = {
|
|
"order_query": "查询 Lazada 订单详情(订单状态、物流信息、商品明细)",
|
|
"product_query": "查询 Lazada 商品详情(标题、价格、库存)",
|
|
"logistics_query": "查询 Lazada 订单物流轨迹",
|
|
"session_list": "获取卖家所有 IM 会话列表",
|
|
"message_history": "获取指定会话的历史消息",
|
|
"orders_query": "批量查询 Lazada 订单列表(支持按状态和时间筛选)",
|
|
"order_items_query": "查询 Lazada 订单商品明细",
|
|
"seller_query": "查询 Lazada 卖家信息(名称、状态、邮箱)",
|
|
}
|
|
|
|
LAZADA_TOOL_SCHEMAS = {
|
|
"order_query": {
|
|
"name": "lazada_order_query",
|
|
"description": "查询 Lazada 订单详情",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"order_id": {"type": "string", "description": "Lazada 订单 ID"},
|
|
},
|
|
"required": ["order_id"],
|
|
},
|
|
},
|
|
"product_query": {
|
|
"name": "lazada_product_query",
|
|
"description": "查询 Lazada 商品详情",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"item_id": {"type": "string", "description": "Lazada 商品 Item ID"},
|
|
},
|
|
"required": ["item_id"],
|
|
},
|
|
},
|
|
"logistics_query": {
|
|
"name": "lazada_logistics_query",
|
|
"description": "查询 Lazada 订单物流轨迹",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"order_id": {"type": "string", "description": "Lazada 订单 ID"},
|
|
},
|
|
"required": ["order_id"],
|
|
},
|
|
},
|
|
"orders_query": {
|
|
"name": "lazada_orders_query",
|
|
"description": "批量查询 Lazada 订单列表",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"status": {"type": "string", "description": "订单状态筛选"},
|
|
"update_after": {"type": "string", "description": "更新时间起点(ISO 格式)"},
|
|
"limit": {"type": "integer", "description": "返回数量上限 (默认 20)"},
|
|
},
|
|
},
|
|
},
|
|
"order_items_query": {
|
|
"name": "lazada_order_items_query",
|
|
"description": "查询 Lazada 订单商品明细",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"order_id": {"type": "string", "description": "Lazada 订单 ID"},
|
|
},
|
|
"required": ["order_id"],
|
|
},
|
|
},
|
|
"seller_query": {
|
|
"name": "lazada_seller_query",
|
|
"description": "查询 Lazada 卖家基本信息",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {},
|
|
},
|
|
},
|
|
}
|