feat: 新增物料/入库单实时 CLIP 向量提取(新建+更新),修复 I/O 延迟和路径解析静默失败
This commit is contained in:
@ -9,6 +9,7 @@ from sqlalchemy import or_, func, text, and_
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
import traceback
|
||||
import json
|
||||
from app.utils.ai_vision import extract_and_embed
|
||||
|
||||
|
||||
class SemiInboundService:
|
||||
@ -220,6 +221,9 @@ class SemiInboundService:
|
||||
detail_link=data.get('detail_link'),
|
||||
remark=data.get('remark')
|
||||
)
|
||||
# 实时提取到货图片向量(失败不影响业务)
|
||||
if new_stock.arrival_photo:
|
||||
new_stock.arrival_image_embedding = extract_and_embed(new_stock.arrival_photo)
|
||||
db.session.add(new_stock)
|
||||
db.session.commit()
|
||||
return new_stock
|
||||
|
||||
Reference in New Issue
Block a user