Merge branch 'feat/enhance-multi-modal-support' into release/0.10.0-beta
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions

This commit is contained in:
-LAN- 2024-10-16 17:28:53 +08:00
commit c390be825b
3 changed files with 9 additions and 9 deletions

View File

@ -135,7 +135,7 @@ class WorkflowCycleManage:
outputs = WorkflowEntry.handle_special_values(outputs) outputs = WorkflowEntry.handle_special_values(outputs)
workflow_run.status = WorkflowRunStatus.SUCCEEDED.value workflow_run.status = WorkflowRunStatus.SUCCEEDED.value
workflow_run.outputs = json.dumps(outputs) if outputs else None workflow_run.outputs = json.dumps(outputs or {})
workflow_run.elapsed_time = time.perf_counter() - start_at workflow_run.elapsed_time = time.perf_counter() - start_at
workflow_run.total_tokens = total_tokens workflow_run.total_tokens = total_tokens
workflow_run.total_steps = total_steps workflow_run.total_steps = total_steps

View File

@ -358,8 +358,8 @@ class TraceTask:
workflow_run_id = workflow_run.id workflow_run_id = workflow_run.id
workflow_run_elapsed_time = workflow_run.elapsed_time workflow_run_elapsed_time = workflow_run.elapsed_time
workflow_run_status = workflow_run.status workflow_run_status = workflow_run.status
workflow_run_inputs = json.loads(workflow_run.inputs) if workflow_run.inputs else {} workflow_run_inputs = workflow_run.inputs_dict
workflow_run_outputs = json.loads(workflow_run.outputs) if workflow_run.outputs else {} workflow_run_outputs = workflow_run.outputs_dict
workflow_run_version = workflow_run.version workflow_run_version = workflow_run.version
error = workflow_run.error or "" error = workflow_run.error or ""

View File

@ -391,7 +391,7 @@ class WorkflowRun(db.Model):
graph = db.Column(db.Text) graph = db.Column(db.Text)
inputs = db.Column(db.Text) inputs = db.Column(db.Text)
status = db.Column(db.String(255), nullable=False) status = db.Column(db.String(255), nullable=False)
outputs = db.Column(db.Text) outputs: Mapped[str] = db.Column(db.Text)
error = db.Column(db.Text) error = db.Column(db.Text)
elapsed_time = db.Column(db.Float, nullable=False, server_default=db.text("0")) elapsed_time = db.Column(db.Float, nullable=False, server_default=db.text("0"))
total_tokens = db.Column(db.Integer, nullable=False, server_default=db.text("0")) total_tokens = db.Column(db.Integer, nullable=False, server_default=db.text("0"))
@ -415,15 +415,15 @@ class WorkflowRun(db.Model):
@property @property
def graph_dict(self): def graph_dict(self):
return json.loads(self.graph) if self.graph else None return json.loads(self.graph) if self.graph else {}
@property @property
def inputs_dict(self): def inputs_dict(self) -> Mapping[str, Any]:
return json.loads(self.inputs) if self.inputs else None return json.loads(self.inputs) if self.inputs else {}
@property @property
def outputs_dict(self): def outputs_dict(self) -> Mapping[str, Any]:
return json.loads(self.outputs) if self.outputs else None return json.loads(self.outputs) if self.outputs else {}
@property @property
def message(self) -> Optional["Message"]: def message(self) -> Optional["Message"]: