OpenAI strict mode rejects optional properties in nested objects
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start from toJSONValueForOpenAIStrictMode() and toJSONValueForOpenResponsesStrictMode(), which currently apply strict-mode rules only to the root object. Walk the schema recursively so every nested object gets the same treatment: all properties listed in required, and optional property types made nullable. The issue's Contact/Address example and the enum-case note in #322 are the cases to check. Done when nested optional properties pass strict mode in both OpenAI and Open Responses schemas, with tests covering nested and enum cases.
索引モデルが issue の本文から書いたものです。
説明
OpenAILanguageModel and OpenResponsesLanguageModel send structured output schemas with strict: true. OpenAI's strict mode requires every property of every object to be in required, with a null type for an optional one. toJSONValueForOpenAIStrictMode() and toJSONValueForOpenResponsesStrictMode() only do this for the root object, so an optional property in a nested object is left out of required.
For example, unit isn't in Address's required here:
@Generable
struct Contact {
var name: String
var address: Address
}
@Generable
struct Address {
var street: String
var unit: String?
}
The same goes for enum cases with optional values, like case note(String?) (#322).
The fix is probably to apply the root's rules to every object in the schema, and make each optional property's type nullable.
- 主要言語
- Swift
- スター
- 948
- フォーク
- 99
- 平均マージ
- 19時間 57分
- マージ済み PR(30日)
- 50
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
huggingface/AnyLanguageModel のほかの issue
-
OpenAILanguageModel replays tool-call arguments as GeneratedContent's Codable form, not JSON対応中かも @gtokman が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
huggingface/AnyLanguageModel#324 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
huggingface/AnyLanguageModel#328 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
huggingface/AnyLanguageModel#326 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Support the Gemini Interactions API in GeminiLanguageModel再び着手できるかも @rizwankce が 7 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
huggingface/AnyLanguageModel#302 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
huggingface/AnyLanguageModel#291 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
huggingface/AnyLanguageModel の issue をすべて見る
似ている issue
-
builtin-port enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
cmlarsen/writemorebetter#235 ·
メンテナーはふだん 1 日以内に返信
-
bug-pending-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NativeScript/NativeScript#11525 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
callstack/agent-device#3627 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信