Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support structured outputs (JSON schema) per message, passed through to provider

オープン
#1,185 コメント 2 件 リアクション 18 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, typescript

調査の方向性

sendMessage または同等の API から開始し、メッセージごとのオプションが OpenAI および Anthropic provider のリクエストにどのように到達するかを追跡します。次に、assistant message の完了およびストリーミングのパスと、preToolUse フックおよび raw-HTTP インターセプターを追跡します。responseFormat が保持され、structuredOutput が assistant message で公開され、未対応の provider が明確なエラーを報告し、列挙された受け入れ基準が満たされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Summary

The Copilot SDK should expose first-class support for structured outputs (JSON schema–constrained responses) when targeting model providers that natively support the feature — OpenAI (response_format: { type: "json_schema", ... }) and Anthropic (structured output / tool-schema). The schema must be settable per message and passed through unchanged to the provider.

Motivation

The primary use case is deterministic agent flows that operate on the output of Copilot Studio agents.

In Copilot Studio, an agent turn is frequently a step inside a larger orchestrated agent flow — its output is not just rendered to a user, it's fed into:

  • Agent flows that expect specific fields in the output
  • Routing/branching logic that switches on a category, intent, or decision

These consumers require stable, schema-validated JSON from the agent turn. Today the SDK only emits free-form assistant text, which forces every agent flow to either:

  1. Post-parse model prose with regex / JSON-extraction heuristics — brittle and silently breaks when the model rephrases.
  2. Coerce JSON via a fake single-tool tool-call — adds a round-trip per turn, pollutes tool-use telemetry, and confuses preToolUse hooks and authoring UX.
  3. Rewrite the outgoing HTTP body in an LLM interceptor to inject response_format — fights the SDK's own retry/streaming logic and is unsupported.

Both OpenAI and Anthropic already accept a JSON schema directly on the request. The SDK is the only layer blocking Copilot Studio from getting deterministic agent output end-to-end.

Proposed API

Structured output must be per message, because different turns in an agent flow need different schemas (classify → plan → extract → summarize).

await session.sendMessage({
  content: "Classify this support ticket.",
  responseFormat: {
    type: "json_schema",
    schema: {
      name: "TicketClassification",
      strict: true,
      schema: {
        type: "object",
        properties: {
          category: { type: "string", enum: ["billing", "technical", "other"] },
          priority: { type: "string", enum: ["low", "medium", "high"] },
          summary: { type: "string" }
        },
        required: ["category", "priority", "summary"],
        additionalProperties: false
      }
    }
  }
});
Requirements
  1. Per-message settingresponseFormat accepted on sendMessage / equivalent. Optional; absent ⇒ current behavior.
  2. Schema passthrough — Forwarded verbatim to the provider request:
    • OpenAI BYOM: response_format: { type: "json_schema", json_schema: <schema> }
    • Anthropic BYOM: equivalent structured output / tool-schema mechanism
  3. Typed result on the assistant message — Parsed JSON exposed on the resulting message (e.g., message.structuredOutput) so agent flows can bind to fields without re-parsing.
  4. Streaming compatible — Final structured payload available on turn completion.
  5. Hook/interceptor friendlypreToolUse hooks and raw-HTTP interceptors observe the schema in the outgoing body unchanged.
  6. Provider capability check — Clear error if the target provider does not support structured output (rather than silently dropping the field).

Non-goals

  • Inventing a new schema dialect — accept JSON Schema as the providers do.
  • Cross-provider schema translation beyond what each provider natively accepts.

Acceptance criteria

  • responseFormat (JSON schema) accepted on per-message send APIs
  • Forwarded verbatim to OpenAI and Anthropic provider requests
  • Sructured payload exposed on the resulting assistant message
  • Works with streaming and with existing hook/interceptor surfaces
  • Clear error when targeting a provider that doesn't support it

References

主要言語
Java
スター
10.5k
フォーク
1.5k
平均マージ
1日 9時間
マージ済み PR(30日)
131

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/copilot-sdk のほかの issue

github/copilot-sdk の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。