尧图网络科技YAOTU DIGITAL 获取报价
获取报价
首页 / 资讯中心 / 文章详情

UFO Dataflow 结果管理与 Schema 校验:instantiation / execution / dataflow 结果目录、JSON 结构与评价机制全解析

发布时间:2026/9/16 13:44:56

资讯中心
01
ARTICLE

UFO Dataflow 结果管理与 Schema 校验:instantiation / execution / dataflow 结果目录、JSON 结构与评价机制全解析

UFO Dataflow 结果管理与 Schema 校验:instantiation / execution / dataflow 结果目录、JSON 结构与评价机制全解析
UFO Dataflow 结果管理与 Schema 校验instantiation / execution / dataflow 结果目录、JSON 结构与评价机制全解析【免费下载链接】UFOUFO³: Weaving the Digital Agent Galaxy项目地址: https://gitcode.com/GitHub_Trending/uf/UFO导读在 UFO 项目的 Dataflow 数据收集流水线中结果远不止一个输出文件而是一套围绕任务类型与评价状态组织的分级目录、一套用于强校验的 JSON Schema以及一份记录了模板选择、预填充Prefill、实例化评价、执行评价与各阶段耗时的结构化 JSON 记录。本文以 result.md 为核心结合仓库内 data_flow_controller.py、两份 Schema 与相关配置完整讲解结果如何落盘、Schema 如何约束每个字段、execution_pass/execution_fail/execution_unsure等目录如何被决定以及如何读懂一条任务从实例化到执行结束的完整 JSON 证据链帮助你在批量收集 LAMLarge Action Model训练数据时正确归档、校验与复用任务结果。结果保存的整体设计目录即状态Schema 即契约在 UFO Dataflow 中任务处理结果统一写入dataflow/results目录并按任务类型instantiation/execution/dataflow进一步划分。整体目录结构如下UFO/ ├── dataflow/ # dataflow 根目录 │ └── results/ # 存放任务处理结果的目录 │ ├── saved_document/ # 最终文档结果目录 │ ├── instantiation/ # 实例化结果目录 │ │ ├── instantiation_pass/ # 实例化成功的任务 │ │ └── instantiation_fail/ # 实例化失败的任务 │ ├── execution/ # 执行结果目录 │ │ ├── execution_pass/ # 执行成功的任务 │ │ ├── execution_fail/ # 执行失败的任务 │ │ └── execution_unsure/ # 执行结果不确定的任务 │ ├── dataflow/ # dataflow 流水线结果目录 │ │ ├── execution_pass/ # 执行成功的任务 │ │ ├── execution_fail/ # 执行失败的任务 │ │ └── execution_unsure/ # 执行结果不确定的任务 │ └── ... └── ...上述结构的设计意图可从以下五个要点理解总览该目录把任务处理结果按instantiation、execution、dataflow三种产出类别组织便于按流水线阶段批量检索与统计。Instantiationinstantiation/instantiation_pass存放实例化成功的任务instantiation/instantiation_fail存放实例化失败的任务它对应实例化阶段的评价instantiation_evaluation判定依据是字段judge。Executionexecution/下按执行结果分为execution_pass成功、execution_fail失败、execution_unsure不确定它对应execute_flow的evaluation结果判定依据是字段complete。Dataflowdataflow/目录结构与execution/一致同样依据execute_flow的evaluation结果字段complete归档。Saved Documents实例化过程中选中的模板会被复制到saved_document/目录单独存放方便直接访问和复用最终文档产物。从源码看这份映射关系被显式编码在 data_flow_controller.py 顶部INSTANTIATION_RESULT_MAP {True: instantiation_pass, False: instantiation_fail} EXECUTION_RESULT_MAP { yes: execution_pass, no: execution_fail, unsure: execution_unsure, }目标目录的判定逻辑结果落盘的核心算法结果到底落到哪个子目录由 DataFlowController.save_result() 决定其判定顺序为先用当前任务的 JSON Schema 对task_info做validate校验来自jsonschema库。若校验失败不中断流程但会在终端打印黄色Validation Error并在保存后提示保存的结果不符合预期 Schema可能需要人工复查。若任务类型为instantiationinstantiation_evaluation.result为空 → 落到instantiation_fail否则取result.judge的布尔值True→instantiation_passFalse→instantiation_fail。若任务类型为execution或dataflowexecution_result.result为空 → 落到execution_fail否则取result.complete的字符串值按yes / no / unsure映射到对应目录未知取值一律落到execution_fail。最终路径由RESULT_HUB配置格式化而来即dataflow/results/{task_type}见 config_dev.yaml拼接目标子目录与原始任务文件名后通过save_json_file落盘data_flow_controller.py。值得注意的是instantiation与execution/dataflow使用不同的 Schema前者使用instantiation_schema.json后两者使用execution_schema.json。该选择逻辑同样在源码中可见data_flow_controller.py。结果数据的统一字段总览所有结果 JSON 都遵循同一顶层结构包含以下字段字段说明unique_id任务的唯一标识符。app处理该任务的应用名称如word、excel、powerpoint。original原始任务信息包含original.original_task原始任务的文字描述。original.original_steps原始任务的步骤列表。execution_result任务执行的结果含执行错误与执行评价。instantiation_result实例化过程详情包含instantiation_result.choose_template模板选择结果及关联错误。instantiation_result.prefill预填充任务信息包括实例化后的请求与计划。instantiation_result.instantiation_evaluation实例化任务的评价结果包括判定与反馈。time_cost各阶段耗时如模板选择、预填充与评价。该结构在源码侧由 DataFlowController.init_task_info() 初始化——除execution模式直接读取已实例化任务文件外其余模式都会先构造这份包含unique_id、app、original、execution_result、instantiation_result、time_cost的骨架对象再在流水线各阶段逐步填充最后由 Schema 统一校验。字段来源任务 JSON 到结果 JSON 的转换original中的数据来自输入任务文件。以 dataflow/templates/word/description.json 同级的任务文件为例一个待实例化的任务 JSON 形如详见 overview.md 的 Tasks as JSON 一节{ app: word, unique_id: 1, task: Type hello and set the font type to Arial, refined_steps: [ Type hello, Set the font to Arial ] }TaskObject 负责解析该文件instantiation/dataflow模式会把 JSON 的键名小写化并写入对象属性execution模式则从original.original_task/original.original_steps中还原task与refined_steps。而app会被映射到 AppEnumWord→winword/.docx、Excel→excel/.xlsx、PowerPoint→powerpnt/.pptx不支持的 app 会直接抛出ValueError。Instantiation 结果 Schema 详解实例化 Schema 位于 dataflow/schema/instantiation_schema.json用于校验任务实例化结果 JSON 的结构。其字段定义如下字段说明unique_id任务唯一标识符。app处理任务的应用名称。original原始任务信息。original.original_task原始任务描述。original.original_steps原始任务步骤列表。execution_result任务执行结果含错误与执行评价。execution_result.result执行结果不适用时为 null。execution_result.error执行过程中遇到的错误详情。instantiation_result实例化过程详情。instantiation_result.choose_template模板选择结果及关联错误。instantiation_result.prefill预填充任务信息实例化请求与计划。instantiation_result.prefill.result实例化请求与计划的详情。instantiation_result.prefill.result.instantiated_request实例化后的任务请求。instantiation_result.prefill.result.instantiated_plan实例化步骤的详情。instantiation_result.prefill.result.instantiated_plan.step步骤序号。instantiation_result.prefill.result.instantiated_plan.subtask子任务描述。instantiation_result.prefill.result.instantiated_plan.control_label步骤的控件标签不适用时为 null。instantiation_result.prefill.result.instantiated_plan.control_text步骤的上下文文本。instantiation_result.prefill.result.instantiated_plan.function该步骤执行的函数。instantiation_result.prefill.result.instantiated_plan.args函数所需参数。instantiation_result.prefill.error预填充过程中的错误如有。instantiation_result.instantiation_evaluation实例化任务的评价结果判定与反馈。instantiation_result.instantiation_evaluation.result详细评价结果。instantiation_result.instantiation_evaluation.result.judge评价是否通过。instantiation_result.instantiation_evaluation.result.thought评价者的反馈或观察。instantiation_result.instantiation_evaluation.result.request_type请求类型分类。instantiation_result.instantiation_evaluation.error评价过程中的错误如有。time_cost各阶段耗时。time_cost.choose_template模板选择阶段耗时。time_cost.prefill预填充阶段耗时。time_cost.instantiation_evaluation评价阶段耗时。time_cost.total任务总耗时。Schema 的类型约束源码级解读对照 instantiation_schema.json 的实际定义可以看到不少值得注意的约束细节顶层required为[unique_id, app, original, execution_result, instantiation_result, time_cost]六个字段缺一不可。original内original_task与original_steps均必填original_steps是字符串数组。execution_result允许为object或null其下result与error的类型均为null——也就是说在纯实例化场景中执行结果字段必须为空占位。prefill.result.instantiated_plan为对象数组每个步骤的required是[Step, Subtask, Function, Args]ControlLabel可为字符串或 nullControlText为字符串Args为additionalProperties: true的任意对象。instantiation_evaluation.result的required是[judge, thought, request_type]其中judge必须是布尔值。time_cost的四个字段choose_template、prefill、instantiation_evaluation、total均必填且类型为number或null。实例化结果示例以下是 result.md 提供的完整实例化结果 JSON对应 Word 中将文本转为项目符号列表任务{ unique_id: 5, app: word, original: { original_task: Turning lines of text into a bulleted list in Word, original_steps: [ 1. Place the cursor at the beginning of the line of text you want to turn into a bulleted list, 2. Click the Bullets button in the Paragraph group on the Home tab and choose a bullet style ] }, execution_result: { result: null, error: null }, instantiation_result: { choose_template: { result: dataflow\\results\\saved_document\\bulleted.docx, error: null }, prefill: { result: { instantiated_request: Turn the line of text text to edit into a bulleted list in Word., instantiated_plan: [ { Step: 1, Subtask: Place the cursor at the beginning of the text text to edit, ControlLabel: null, ControlText: , Function: select_text, Args: { text: text to edit } }, { Step: 2, Subtask: Click the Bullets button in the Paragraph group on the Home tab, ControlLabel: null, ControlText: Bullets, Function: click_input, Args: { button: left, double: false } } ] }, error: null }, instantiation_evaluation: { result: { judge: true, thought: The task is specific and involves a basic function in Word that can be executed locally without any external dependencies., request_type: None }, error: null } }, time_cost: { choose_template: 0.012, prefill: 15.649, instantiation_evaluation: 2.469, execute: null, execute_eval: null, total: 18.130 } }从这份示例可以读出完整的事实链choose_template.result指向dataflow/results/saved_document/bulleted.docx说明模板文件已被复制到 saved_document 目录这也是结果文档的最终落盘位置prefill.result.instantiated_plan给出了每一步的 UI 操作抽象select_text、click_inputControlText为Bullets对应 Word 功能区的按钮文本instantiation_evaluation.result.judge true表示实例化质量通过评价因此该任务会被归入instantiation_passtime_cost中execute与execute_eval为 null符合纯实例化场景下执行字段留空的设计。Execution 结果 Schema 详解执行 Schema 位于 dataflow/schema/execution_schema.json用于校验执行或dataflow流水线任务的结果。它比实例化 Schema 增加了执行反馈维度突出记录关键成功指标reason、sub_scores、complete这些信息存放在execution_result.result中。关键增强点包括instantiated_plan中的每个步骤被追加了两个字段Success指示该步骤是否成功执行无错误。MatchedControlText记录最终匹配到的控件文本。ControlLabel被更新为最终选中的控件标签。time_cost中的execute、execute_eval与total会被更新。其字段定义如下字段说明unique_id任务唯一标识符。app处理任务的应用名称。original原始任务信息。original.original_task原始任务描述。original.original_steps原始任务步骤列表。execution_result任务执行结果含错误与执行评价。execution_result.result任务执行结果。execution_result.error执行过程中出现的错误。instantiation_result任务实例化详情。instantiation_result.choose_template.result模板选择结果。instantiation_result.choose_template.error模板选择错误如有。instantiation_result.prefill.result.instantiated_request实例化后的任务请求。instantiation_result.prefill.result.instantiated_plan.Step步骤序号。instantiation_result.prefill.result.instantiated_plan.Subtask子任务描述。instantiation_result.prefill.result.instantiated_plan.ControlLabel步骤的控件标签。instantiation_result.prefill.result.instantiated_plan.ControlText步骤的上下文文本。instantiation_result.prefill.result.instantiated_plan.Function该步骤执行的函数。instantiation_result.prefill.result.instantiated_plan.Args函数所需参数。instantiation_result.prefill.result.instantiated_plan.Success该步骤是否无错误地成功执行。instantiation_result.prefill.result.instantiated_plan.MatchedControlText执行流程中最终匹配到的控件文本。instantiation_result.prefill.error预填充错误如有。instantiation_result.instantiation_evaluation.result.judge评价是否通过。instantiation_result.instantiation_evaluation.result.thought评价者的反馈。instantiation_result.instantiation_evaluation.result.request_type请求类型分类。instantiation_result.instantiation_evaluation.error评价错误如有。time_cost各阶段耗时包括time_cost.choose_template模板选择阶段耗时。time_cost.prefill预填充阶段耗时。time_cost.instantiation_evaluation评价阶段耗时。time_cost.execute执行阶段耗时。time_cost.execute_eval执行评价阶段耗时。time_cost.total任务总耗时。执行结果 Schema 的类型约束源码级解读对照 execution_schema.json 的实际定义execution_result.result为object或null其required为[reason, sub_scores, complete]reason为字符串sub_scores是通过patternProperties约束的任意键 → 字符串值对象用于记录每个子目标的完成情况如text selection: yescomplete为字符串取值一般为yes/no/unsure。execution_result.error为null或对象错误对象含type、message、traceback三个必填字符串字段。在 execute_execution() 中异常会被包装为{type: ..., message: ..., traceback: ...}写入该字段。instantiated_plan每个步骤的required变为[Step, Subtask, Function, Args, Success, MatchedControlText]其中Success为布尔值或 nullMatchedControlText为字符串或 null。time_cost的required变为[choose_template, prefill, instantiation_evaluation, execute, execute_eval, total]全部为number或null。执行结果示例{ unique_id: 5, app: word, original: { original_task: Turning lines of text into a bulleted list in Word, original_steps: [ 1. Place the cursor at the beginning of the line of text you want to turn into a bulleted list, 2. Click the Bullets button in the Paragraph group on the Home tab and choose a bullet style ] }, execution_result: { result: { reason: The agent successfully selected the text text to edit and then clicked on the Bullets button in the Word application. The final screenshot shows that the text text to edit has been converted into a bulleted list., sub_scores: { text selection: yes, bulleted list conversion: yes }, complete: yes }, error: null }, instantiation_result: { choose_template: { result: dataflow\\results\\saved_document\\bulleted.docx, error: null }, prefill: { result: { instantiated_request: Turn the line of text text to edit into a bulleted list in Word., instantiated_plan: [ { Step: 1, Subtask: Place the cursor at the beginning of the text text to edit, ControlLabel: null, ControlText: , Function: select_text, Args: { text: text to edit }, Success: true, MatchedControlText: null }, { Step: 2, Subtask: Click the Bullets button in the Paragraph group on the Home tab, ControlLabel: 61, ControlText: Bullets, Function: click_input, Args: { button: left, double: false }, Success: true, MatchedControlText: Bullets } ] }, error: null }, instantiation_evaluation: { result: { judge: true, thought: The task is specific and involves a basic function in Word that can be executed locally without any external dependencies., request_type: None }, error: null } }, time_cost: { choose_template: 0.012, prefill: 15.649, instantiation_evaluation: 2.469, execute: 5.824, execute_eval: 8.702, total: 43.522 } }与实例化示例对比执行结果在三个层面产生了显著变化execution_result.result被填充reason是评价 agent 对整段执行过程的自然后续描述sub_scores按子目标逐项给出yescomplete yes直接决定结果归档到execution_pass。步骤级反馈第 2 步的ControlLabel从 null 更新为61执行时实际选中的控件索引MatchedControlText记录为BulletsSuccess均为true表示每一步都无错误完成。time_cost增加执行阶段execute: 5.824、execute_eval: 8.702、total: 43.522完整反映从实例化到执行评价的全流程耗时。步骤级反馈字段的写入位置Success与MatchedControlText并非 Schema 凭空要求而是由执行流程真实写入。在 execute_flow.py 的execute_plan中执行前为每个步骤初始化instantiated_plan[index][Success] None、MatchedControlText None每步执行成功后将Success置为True并写入实际匹配到的控件标签与文本ControlLabel、MatchedControlText若某步找不到控件或执行异常Success置为False并抛出RuntimeError。此外ExecuteFlow.execute() 用execution_time与eval_time分别记录执行与评价耗时DataFlowController.execute_execution() 再把这两个值回填到task_info[time_cost][execute]与[execute_eval]最终形成上文示例中的完整时间统计。结果目录与配置的对应关系结果保存行为高度依赖 dataflow/config/config_dev.yaml 中的若干配置项配置项默认值作用RESULT_HUBdataflow/results/{task_type}结果根目录模板task_type取instantiation/execution/dataflow。INSTANTIATION_RESULT_SCHEMAdataflow/schema/instantiation_schema.json实例化结果的 JSON Schema 路径。EXECUTION_RESULT_SCHEMAdataflow/schema/execution_schema.json执行/dataflow 结果的 JSON Schema 路径。REFORMAT_TO_BATCHTrue是否将 dataflow 结果重排为 UFO 批量模式的任务格式。REFORMAT_TO_BATCH_HUBdatasUFO重排后结果的输出目录。TASKS_HUBdataflow/tasks/prefill默认任务目录--task_path缺省时使用。LOG_PATHdataflow/logs/{task}各任务日志根目录。MAX_STEPS30execute_flow的最大执行步数超限即终止并报错。其中RESULT_HUB由 DataFlowController.init格式化为dataflow/results/{task_type}配合上文目录树即可解释为什么dataflow与execution的结果目录里都有execution_pass/execution_fail/execution_unsure——二者共用同一套执行结果判定与 Schema。批量任务的自动重排当REFORMAT_TO_BATCH: True时任务运行结束后 reformat_to_batch() 会把dataflow/results/{task_type}_pass下通过的任务重排为 UFO 批量模式的输入格式写入datasUFO/tasks/同时把saved_document中对应的 docx 复制到datasUFO/files/。重排逻辑实现在 learner/utils.py仅当instantiation_evaluation.result.judge为真时才抽取instantiated_request作为新任务文本、template_path作为对象路径写入{ task: ..., object: ..., close: True }评价未通过的任务则被过滤掉不会被重排进批量数据集。结果文件的保存与校验流程小结综合源码一条任务从运行到落盘的完整链路为DataFlowController依据任务类型加载对应 Schemadata_flow_controller.py并通过init_task_info()构造结果骨架data_flow_controller.py。run()按任务类型执行dataflow依次执行execute_instantiation()与execute_execution()instantiation只执行实例化execution读取已实例化计划并执行data_flow_controller.py。各阶段模板选择、prefill、实例化评价、执行、执行评价的结果与耗时被逐段写入task_info异常则按 Schema 要求的type / message / traceback结构记录到对应error字段data_flow_controller.py。save_result()先以jsonschema.validate校验失败仅告警不中断再按任务类型与judge/complete判定目标子目录并落盘data_flow_controller.py。若开启REFORMAT_TO_BATCH通过评价的任务会被重排为 UFO 批量模式格式learner/utils.py。对使用者而言最常用的验证动作是运行python -m dataflow -dataflow --task_path path_to_task_file单任务或python -m dataflow -dataflow --task_path path_to_task_dir批量--task_path缺省时默认指向dataflow/tasks/prefill参见 dataflow.py随后到dataflow/results/{task_type}下核对结果文件是否落入预期的pass / fail / unsure子目录并用instantiation_schema.json/execution_schema.json对结果做二次校验。若终端出现黄色Validation Error提示说明保存结果与 Schema 存在偏差建议人工复查该任务记录。延伸阅读数据流整体介绍与运行方式overview.md实例化阶段模板选择 / prefill / filter详解instantiation.md执行阶段ExecuteFlow 与执行评价详解execution.mdWindows 应用环境与控件匹配策略contains/fuzzy/regexwindows_app_env.md结果落盘与重排的实现数据流控制器 dataflow/data_flow_controller.py、执行流程 dataflow/execution/workflow/execute_flow.py、批量重排工具 learner/utils.py结果校验 Schemadataflow/schema/instantiation_schema.json 与 dataflow/schema/execution_schema.json相关配置dataflow/config/config_dev.yaml 与 dataflow/config/config.yaml.template【免费下载链接】UFOUFO³: Weaving the Digital Agent Galaxy项目地址: https://gitcode.com/GitHub_Trending/uf/UFO创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考
02
RELATED NEWS

相关资讯

更多网站建设与数字化升级内容

03
WHY YAOTU

想打造同款高转化官网?

懂行业、懂生意,从建站到增长一站式陪跑

场景化定制

不做模板站,围绕你的业务场景量身设计,小众不撞款。

营销型架构

以转化目标组织内容与路径,让官网真正带来询盘。

全周期服务

设计、开发、运营、运维一体,上线只是开始。

免费获取你的建站方案

留下需求,专属顾问 24 小时内为你输出方案建议。