删除outfit 图片item文字信息,新增换脸模型接口。
This commit is contained in:
@@ -150,7 +150,7 @@ class AsyncStylistAgent:
|
||||
# self._clear_uploaded_files()
|
||||
# 1. 添加图片内容
|
||||
if self.outfit_items:
|
||||
merged_image = merge_images_to_square(self.outfit_items, max_len=self.max_len)
|
||||
merged_image = merge_images_to_square(self.outfit_items, max_len=self.max_len, add_text=False)
|
||||
image_bytes_io = io.BytesIO()
|
||||
image_format = 'JPEG'
|
||||
mime_type = 'image/jpeg'
|
||||
@@ -275,6 +275,7 @@ class AsyncStylistAgent:
|
||||
}
|
||||
logger.info(response_data)
|
||||
item_id = ""
|
||||
item_category = ""
|
||||
while True:
|
||||
# 1. 准备用户输入(上下文)
|
||||
user_input = self._build_user_input()
|
||||
@@ -284,7 +285,7 @@ class AsyncStylistAgent:
|
||||
gemini_data = self._parse_gemini_response(gemini_response_text)
|
||||
response_data['path'] = minio_path
|
||||
if item_id:
|
||||
response_data['items'].append(item_id)
|
||||
response_data['items'].append({"item_id": item_id, "category": item_category})
|
||||
if not gemini_data:
|
||||
print("🚨 Agent 返回无效响应,终止流程。")
|
||||
self.stop_reason = "Agent failed to return response"
|
||||
@@ -316,6 +317,7 @@ class AsyncStylistAgent:
|
||||
# 4b. 在本地 DB 中查询单品
|
||||
new_item = self._get_next_item(description, category)
|
||||
item_id = new_item.get('item_id')
|
||||
item_category = new_item.get('category')
|
||||
|
||||
if new_item:
|
||||
# 4c. (实际步骤) 将选中的单品图片和描述发回给 Agent 进行最终审核
|
||||
|
||||
Reference in New Issue
Block a user