fix: change to use convert_stream_full_response

This commit is contained in:
Yeuoly 2024-11-27 14:48:44 +08:00
parent db726e02a0
commit e39eddab03
No known key found for this signature in database
GPG Key ID: A66E7E320FB19F61
2 changed files with 7 additions and 7 deletions

View File

@ -22,7 +22,7 @@ class AppGenerateResponseConverter(ABC):
else: else:
def _generate_full_response() -> Generator[dict | str, Any, None]: def _generate_full_response() -> Generator[dict | str, Any, None]:
yield from cls.convert_stream_simple_response(response) yield from cls.convert_stream_full_response(response)
return _generate_full_response() return _generate_full_response()
else: else:

View File

@ -292,9 +292,9 @@ class WorkflowCycleManage:
db.session.query(WorkflowNodeExecution).filter(WorkflowNodeExecution.id == workflow_node_execution.id).update( db.session.query(WorkflowNodeExecution).filter(WorkflowNodeExecution.id == workflow_node_execution.id).update(
{ {
WorkflowNodeExecution.status: WorkflowNodeExecutionStatus.SUCCEEDED.value, WorkflowNodeExecution.status: WorkflowNodeExecutionStatus.SUCCEEDED.value,
WorkflowNodeExecution.inputs: json.dumps(inputs) if inputs else None, WorkflowNodeExecution.inputs: json.dumps(inputs) if inputs else "{}",
WorkflowNodeExecution.process_data: json.dumps(process_data) if event.process_data else None, WorkflowNodeExecution.process_data: json.dumps(process_data) if event.process_data else "{}",
WorkflowNodeExecution.outputs: json.dumps(outputs) if outputs else None, WorkflowNodeExecution.outputs: json.dumps(outputs) if outputs else "{}",
WorkflowNodeExecution.execution_metadata: execution_metadata, WorkflowNodeExecution.execution_metadata: execution_metadata,
WorkflowNodeExecution.finished_at: finished_at, WorkflowNodeExecution.finished_at: finished_at,
WorkflowNodeExecution.elapsed_time: elapsed_time, WorkflowNodeExecution.elapsed_time: elapsed_time,
@ -306,9 +306,9 @@ class WorkflowCycleManage:
process_data = WorkflowEntry.handle_special_values(event.process_data) process_data = WorkflowEntry.handle_special_values(event.process_data)
workflow_node_execution.status = WorkflowNodeExecutionStatus.SUCCEEDED.value workflow_node_execution.status = WorkflowNodeExecutionStatus.SUCCEEDED.value
workflow_node_execution.inputs = json.dumps(inputs) if inputs else None workflow_node_execution.inputs = json.dumps(inputs) if inputs else "{}"
workflow_node_execution.process_data = json.dumps(process_data) if process_data else None workflow_node_execution.process_data = json.dumps(process_data) if process_data else "{}"
workflow_node_execution.outputs = json.dumps(outputs) if outputs else None workflow_node_execution.outputs = json.dumps(outputs) if outputs else "{}"
workflow_node_execution.execution_metadata = execution_metadata workflow_node_execution.execution_metadata = execution_metadata
workflow_node_execution.finished_at = finished_at workflow_node_execution.finished_at = finished_at
workflow_node_execution.elapsed_time = elapsed_time workflow_node_execution.elapsed_time = elapsed_time