|
@@ -130,6 +130,8 @@ def create_langgraph_workflow():
|
|
|
|
|
|
item = items[current_index]
|
|
|
state["current_item"] = item
|
|
|
+ state["content_id"] = item.get('content_id') or ''
|
|
|
+ state["task_id"] = item.get('task_id') or ''
|
|
|
state["current_index"] = current_index + 1
|
|
|
|
|
|
# 处理当前项
|
|
@@ -144,7 +146,10 @@ def create_langgraph_workflow():
|
|
|
# Step 2: 结构化并入库
|
|
|
affected = StructureTool.store_parsing_result(
|
|
|
state["request_id"],
|
|
|
- item.get('raw') or {},
|
|
|
+ {
|
|
|
+ "content_id": state["content_id"],
|
|
|
+ "task_id": state["task_id"]
|
|
|
+ },
|
|
|
identify_result
|
|
|
)
|
|
|
|
|
@@ -319,7 +324,10 @@ async def parse_processing(request: TriggerRequest, background_tasks: Background
|
|
|
# Step 2: 结构化并入库
|
|
|
affected = StructureTool.store_parsing_result(
|
|
|
request.requestId,
|
|
|
- item.get('raw') or {},
|
|
|
+ {
|
|
|
+ content_id: item.get('content_id') or '',
|
|
|
+ task_id: item.get('task_id') or ''
|
|
|
+ },
|
|
|
identify_result
|
|
|
)
|
|
|
|
|
@@ -418,6 +426,7 @@ async def process_request_background(request_id: str):
|
|
|
for idx, item in enumerate(items, start=1):
|
|
|
try:
|
|
|
crawl_data = item.get('crawl_data') or {}
|
|
|
+ content_id = item.get('content_id') or ''
|
|
|
|
|
|
identify_result = identify_tool.run(
|
|
|
crawl_data if isinstance(crawl_data, dict) else {}
|
|
@@ -425,7 +434,10 @@ async def process_request_background(request_id: str):
|
|
|
|
|
|
affected = StructureTool.store_parsing_result(
|
|
|
request_id,
|
|
|
- item.get('raw') or {},
|
|
|
+ {
|
|
|
+ content_id: item.get('content_id') or '',
|
|
|
+ task_id: item.get('task_id') or ''
|
|
|
+ },
|
|
|
identify_result
|
|
|
)
|
|
|
|