{
  "format": "agent-article-v0",
  "article_id": "GX-0016",
  "content_family": "GX",
  "public_kind": "ARTICLE_PRODUCT",
  "revision_id": "GX-0016-R20261027-01",
  "canonical_url": "/providers/gx-0016-openai-api-function-calling-structured-outputs",
  "page_type": "reference",
  "claim_ids": [],
  "evidence_ids": [],
  "unknown_ids": [
    "GX-0016-UNKNOWN-01"
  ],
  "operational_object_ids": [],
  "provider": [
    "OpenAI"
  ],
  "models": [
    "Function Calling and Structured Outputs"
  ],
  "plans": [],
  "surfaces": [
    "schema constrained tool calls"
  ],
  "regions": [],
  "current_status": "CURRENT",
  "observation_status": "UNOBSERVED",
  "freshness": "CURRENT",
  "last_verified": "2026-10-27",
  "supersedes": [],
  "superseded_by": [],
  "provenance": [],
  "article_sources": [],
  "research_sections": [
    {
      "heading": "概要",
      "text": "OpenAI APIのFunction Callingはモデルをアプリケーション定義ツールへ接続する仕組みで、Structured OutputsはJSON Schemaへの適合を強化する仕組みです。2026-10-27の現行公式文書では、Responses APIのfunction callingはstrictを省略すると可能な場合はstrictへ正規化し、互換化できないschemaではnon-strictへfallbackしてresolved toolにstrict:falseを示します。一方、Chat Completionsはnon-strictが既定です。API差を無視して「strictが常に既定」と一般化しません。"
    },
    {
      "heading": "strict modeの境界",
      "text": "strict:trueではfunction argumentsを対応JSON Schemaへ制約します。各objectでadditionalProperties:falseが必要で、propertiesの全fieldをrequiredにする必要があります。optional相当はnullを型に含めて表現できます。Structured Outputs自体もJSON Schema全体ではなくサポート対象subsetに制約されます。unsupported schemaをstrict:trueで送ればrequest errorになり得ます。\n\nStructured Outputsはfunction callingと通常応答の構造化の双方に使えます。Responses APIで通常応答を構造化する場合はtext.formatを使い、tool接続を行う場合はfunction callingを使います。JSON modeはvalid JSONを目的としますがschema adherenceは保証しないため、両者を同一視しません。"
    },
    {
      "heading": "実行保証とは別層",
      "text": "schema conformanceは、正しいtoolを選んだこと、業務上正しい値であること、外部toolの実行成功、副作用のexactly-once、retryの冪等性を保証しません。Responses APIではfunction call itemとfunction_call_outputをcall_idで対応付けます。アプリケーション側はcall identity、実行結果、外部副作用のreadbackを保存し、timeoutや再試行時に同一副作用を無条件で再実行しない設計が必要です。"
    },
    {
      "heading": "parallel / streaming境界",
      "text": "モデルは複数functionを呼べる場合があり、parallel_tool_calls:falseで一度に0または1 callへ制約できます。現行公式文書はfine-tuned modelで複数functionを同一turnに呼ぶ場合strict modeが無効になる注意を明記しています。Responses streamingではtyped eventsを処理し、function_call_arguments.delta / done等をAPI契約に従って再構成します。Chat Completionsのdelta処理をそのままResponsesへ移植しません。"
    },
    {
      "heading": "運用実装",
      "text": "1. API surfaceとmodel capabilityを固定し、resolved strict stateを観測する。\n2. schema validationとbusiness validationを分離する。\n3. tool call IDと実行結果を永続化し、副作用toolにはidempotency/deduplication guardを置く。\n4. streaming・parallel・HITL/resumeを使う場合はitem対応、重複、欠落、再送をversionごとにテストする。\n5. provider/SDK issueはversion-specific evidenceとして扱い、現行backend全体の障害率へ一般化しない。"
    },
    {
      "heading": "Availability / failure boundary",
      "text": "Structured Outputsは現行の対応modelで利用できますが、model・API surface・fine-tuning条件により制約が異なります。schema adherenceが成立しても内容上の誤りは残り得ます。user inputがschemaと無関係でもモデルはschemaへ合わせようとするため、入力不能時の表現をprompt/schemaで設計します。"
    },
    {
      "heading": "Unconfirmed",
      "text": "provider内部のtool-selection失敗率、すべてのmodel/SDK/versionにおけるstreaming・parallel・resumeの同一挙動、外部tool副作用に対するprovider側exactly-once保証は公開文書だけでは確定しません。利用時点のAPI契約と実行readbackを正とします。"
    },
    {
      "heading": "原著の公式参照先（未検証）",
      "text": "以下は原研究に記録された公式資料へのリンクです。現在の内容、資料の更新日、個別主張の妥当性を新たに検証したものではありません。\n- https://developers.openai.com/api/docs/guides/function-calling\n- https://developers.openai.com/api/docs/guides/structured-outputs\n- https://developers.openai.com/api/docs/guides/migrate-to-responses"
    }
  ],
  "human_url": "/providers/gx-0016-openai-api-function-calling-structured-outputs",
  "markdown_url": "/agent/article.md?path=%2Fproviders%2Fgx-0016-openai-api-function-calling-structured-outputs",
  "json_url": "/agent/article.json?path=%2Fproviders%2Fgx-0016-openai-api-function-calling-structured-outputs"
}