You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Cloud Document AI Python请求中field_mask获取formFields字段异常

解决Google Cloud Document AI Field Mask 语法问题
  • 正确的field_mask写法需要完整指定嵌套字段路径,数组类型字段无需添加索引,你需要的字段对应的mask应该是:

    text,pages.tables,formFields.fieldName.textAnchor.content,formFields.fieldValue.textAnchor.content
    
  • 导致请求无响应的原因大概率是field_mask路径错误,比如错误添加数组下标(如formFields[0].fieldName.textAnchor.content),或者路径层级不完整。Document AI的field_mask支持直接指定数组字段的子路径,服务会自动遍历数组中的所有元素返回对应子字段。

  • 测试建议:可以先单独使用formFields相关的mask进行请求验证,确认能正常返回结果后,再组合text和pages.tables字段。

内容的提问来源于stack exchange,提问作者Developer Team The Cloud Gate

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 08:09:23