功能:交互Agent支持图片驱动的手动工单创建流程
This commit is contained in:
@@ -18,13 +18,18 @@ class UserSession:
|
||||
|
||||
def __init__(self, user_id: str):
|
||||
self.user_id = user_id
|
||||
self.state = "idle" # idle / waiting_close_photo
|
||||
self.state = "idle" # idle / waiting_close_photo / waiting_manual_order_area / waiting_manual_order_remark / waiting_manual_order_confirm
|
||||
self.pending_image_url = "" # 暂存的图片 COS key
|
||||
self.pending_analysis = "" # VLM 分析结果描述
|
||||
self.pending_alarm_type = "" # VLM 识别的告警类型
|
||||
self.pending_order_id = "" # 待结单的工单 ID
|
||||
self.pending_alarm_id = "" # 关联的告警 ID
|
||||
self.pending_images: List[str] = [] # 暂存用户上传的图片 URL(用于工单结单)
|
||||
self.pending_manual_order_images: List[str] = []
|
||||
self.pending_manual_order_area_id = ""
|
||||
self.pending_manual_order_area_name = ""
|
||||
self.pending_manual_order_area_options: List[Dict] = []
|
||||
self.pending_manual_order_remark = ""
|
||||
self.history: List[Dict] = [] # 对话历史 [{"role": "user/assistant", "content": ...}]
|
||||
self.updated_at = time.time()
|
||||
|
||||
@@ -43,6 +48,11 @@ class UserSession:
|
||||
self.pending_order_id = ""
|
||||
self.pending_alarm_id = ""
|
||||
self.pending_images = []
|
||||
self.pending_manual_order_images = []
|
||||
self.pending_manual_order_area_id = ""
|
||||
self.pending_manual_order_area_name = ""
|
||||
self.pending_manual_order_area_options = []
|
||||
self.pending_manual_order_remark = ""
|
||||
|
||||
def add_history(self, role: str, content):
|
||||
"""添加对话记录,content 可以是 str 或 list(多模态)"""
|
||||
|
||||
Reference in New Issue
Block a user