From bee9e3d2dc2101dce69f3e7d9c09827ece8b2a65 Mon Sep 17 00:00:00 2001 From: zjf Date: Mon, 26 May 2025 16:19:59 +0800 Subject: [PATCH] rpa --- src/cluster/rpa.md | 6 ++++++ src/cluster/rpa.py | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 src/cluster/rpa.md diff --git a/src/cluster/rpa.md b/src/cluster/rpa.md new file mode 100644 index 0000000..e8e0c37 --- /dev/null +++ b/src/cluster/rpa.md @@ -0,0 +1,6 @@ + + +deploy by env +```shell +modal deploy --env dev cluster.rpa +``` \ No newline at end of file diff --git a/src/cluster/rpa.py b/src/cluster/rpa.py index a98f0be..db56251 100644 --- a/src/cluster/rpa.py +++ b/src/cluster/rpa.py @@ -3,7 +3,7 @@ import hashlib import json import os import time -from typing import List, Optional +from typing import List, Optional,Any import modal from loguru import logger @@ -27,20 +27,41 @@ app = modal.App(name='rpa', image=rpa_image, include_source=False) # Define Pydantic models class ProductSession(BaseModel): - start_time: int - end_time: int - duration: int - product_name: str - product_id: str - product_img: str + start_time: Optional[int] = 0 + """当前商品直播开始世界时间(毫秒时间戳)""" + end_time: Optional[int] = 0 + """当前商品直播结束世界时间(毫秒时间戳)""" + duration: Optional[int] = 0 + """当前商品直播持续时间(毫秒)""" + product_name: Optional[str] = None + """商品名称""" + product_id: Optional[str] = None + """商品id""" + product_img: Optional[str] = None + """商品图片url""" + start_canvas_img: Optional[str] = None + """当前商品直播开始截图""" + end_canvas_img: Optional[str] = None + """当前商品直播结束截图""" + ext_data: Optional[Any] = None + """扩展字段""" class LiveStreamResult(BaseModel): title: Optional[str] = None - live_id: str + """直播间名称""" + live_id: Optional[str] = None + """直播间id""" + start_time: Optional[int] = 0 + """直播开始世界时间(毫秒时间戳)""" product_sessions: List[ProductSession] = [] - duration: int = 0 + """直播所有商品记录""" + duration: Optional[int] = 0 + """直播持续时间""" cut_commands: List[str] = [] + """冗余字段""" + ext_data: Optional[Any] = None + """扩展字段""" error: Optional[str] = None msg: Optional[str] = None