Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor(api): type _serialize_full_content with FullContentDict TypedDict (#35000)
YBoy6bacf7f95397
diff --git a/api/controllers/console/app/workflow_draft_variable.py b/api/controllers/console/app/workflow_draft_variable.pyindex 9771d6f1e52..657e794ac4e 100644--- a/api/controllers/console/app/workflow_draft_variable.py+++ b/api/controllers/console/app/workflow_draft_variable.py@@ -1,7 +1,7 @@import loggingfrom collections.abc import Callablefrom functools import wraps-from typing import Any+from typing import Any, TypedDictfrom flask import Response, requestfrom flask_restx import Resource, fields, marshal, marshal_with@@ -86,7 +86,14 @@ def _serialize_variable_type(workflow_draft_var: WorkflowDraftVariable) -> str:return value_type.exposed_type().value-def _serialize_full_content(variable: WorkflowDraftVariable) -> dict | None:+class FullContentDict(TypedDict):+ size_bytes: int | None+ value_type: str+ length: int | None+ download_url: str+++def _serialize_full_content(variable: WorkflowDraftVariable) -> FullContentDict | None:"""Serialize full_content information for large variables."""if not variable.is_truncated():return None@@ -94,12 +101,13 @@ def _serialize_full_content(variable: WorkflowDraftVariable) -> dict | None:variable_file = variable.variable_fileassert variable_file is not None- return {+ result: FullContentDict = {"size_bytes": variable_file.size,"value_type": variable_file.value_type.exposed_type().value,"length": variable_file.length,"download_url": file_helpers.get_signed_file_url(variable_file.upload_file_id, as_attachment=True),}+ return resultdef _ensure_variable_access(