引导式测验 · 中等 等级

结构化输出测验

测试架构所需的字段、空值、额外属性、算术和源代码检查、拒绝、版本控制以及为什么有效的 JSON 仍然可能是错误的。

相关引导路径结构化输出
问题 1 的 8

A JSON Schema declares a property named total. What must also be specified if every response must include it?

预览每个问题8 问题

当您参加测验时,就会出现答案和解释。

  1. A JSON Schema declares a property named total. What must also be specified if every response must include it?
    • Set its numeric type only
    • Add total to the required-field list
    • Place it first in the schema file
    • Give the object a longer description
  2. Why decide whether additional object fields are allowed?
    • Any extra property always proves hallucination
    • JSON syntax forbids all additional properties
    • Only arrays can contain unexpected fields
    • Unexpected fields can change how downstream code interprets a response
  3. A missing value and an explicit null have different meanings in an integration. What should the schema specify?
    • Their separate allowed behavior and downstream interpretation
    • Treat absence and null as the same without documentation
    • Replace both with a fabricated zero
    • Let every provider choose silently
  4. A receipt has subtotal 50 and tax 5; valid JSON reports total 550. What failed?
    • JSON parsing
    • The total field’s numeric type
    • Factual and arithmetic validation against the source
    • The existence of an object schema
  5. A structured result cites source_id 9, but only IDs 1 through 3 were supplied. What check catches the error?
    • Check that source_id is a string
    • Count the object’s top-level keys
    • Accept any integer because its type is valid
    • Verify that referenced identifiers actually exist in the supplied evidence
  6. How should an application handle a model refusal or truncated response?
    • Assume every schema field was produced
    • Treat it as an explicit non-success case rather than inventing required values
    • Silently fill missing evidence with plausible defaults
    • Ignore the boundary because JSON mode was requested
  7. A stored output uses schema v1 but a consumer expects v2. What should the integration do?
    • Apply v2 assumptions without checking
    • Remove the version field
    • Reject or explicitly adapt the incompatible version
    • Assume schema changes affect only formatting
  8. Two providers offer structured output, one constrains generation and one validates afterward. Which practice remains necessary for both?
    • Check supported schema features and verify the values’ meaning
    • Assume identical enforcement for every schema keyword
    • Skip factual checks when output parses
    • Treat post-validation as a guarantee of truth