Skip to content

Commit e5d0916

Browse files
EleanorWhoclaude
andcommitted
fix(api): fix field-level schema mismatches in Responses models
Correct Pydantic model field definitions so the generated OpenAPI schema matches the OpenResponses reference spec for POST /responses: - Add ResponseTruncation enum to replace bare str for truncation fields - Add deprecated generate_summary field to OpenAIResponseReasoning - Make parallel_tool_calls non-nullable bool on response model - Fix store/stream to emit correct nullable schema without default - Fix stream_options.include_obfuscation to be nullable without default - Add schema_utils helpers for default/nullable schema manipulation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Eleanor Hu <ehu@redhat.com>
1 parent 2a4be91 commit e5d0916

12 files changed

Lines changed: 171 additions & 136 deletions

File tree

client-sdks/stainless/openapi.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7182,7 +7182,6 @@ components:
71827182
parallel_tool_calls:
71837183
type: boolean
71847184
title: Parallel Tool Calls
7185-
default: true
71867185
previous_response_id:
71877186
anyOf:
71887187
- type: string
@@ -7205,9 +7204,6 @@ components:
72057204
title: Temperature
72067205
text:
72077206
$ref: '#/components/schemas/OpenAIResponseText'
7208-
default:
7209-
format:
7210-
type: text
72117207
top_p:
72127208
type: number
72137209
title: Top P
@@ -7272,8 +7268,10 @@ components:
72727268
title: OpenAIResponseInputToolChoiceMode
72737269
truncation:
72747270
anyOf:
7275-
- type: string
7271+
- $ref: '#/components/schemas/ResponseTruncation'
7272+
title: ResponseTruncation
72767273
- type: 'null'
7274+
title: ResponseTruncation
72777275
usage:
72787276
anyOf:
72797277
- $ref: '#/components/schemas/OpenAIResponseUsage'
@@ -7618,7 +7616,6 @@ components:
76187616
parallel_tool_calls:
76197617
type: boolean
76207618
title: Parallel Tool Calls
7621-
default: true
76227619
previous_response_id:
76237620
anyOf:
76247621
- type: string
@@ -7641,9 +7638,6 @@ components:
76417638
title: Temperature
76427639
text:
76437640
$ref: '#/components/schemas/OpenAIResponseText'
7644-
default:
7645-
format:
7646-
type: text
76477641
top_p:
76487642
type: number
76497643
title: Top P
@@ -7708,8 +7702,10 @@ components:
77087702
title: OpenAIResponseInputToolChoiceMode
77097703
truncation:
77107704
anyOf:
7711-
- type: string
7705+
- $ref: '#/components/schemas/ResponseTruncation'
7706+
title: ResponseTruncation
77127707
- type: 'null'
7708+
title: ResponseTruncation
77137709
usage:
77147710
anyOf:
77157711
- $ref: '#/components/schemas/OpenAIResponseUsage'
@@ -11452,7 +11448,6 @@ components:
1145211448
- type: boolean
1145311449
- type: 'null'
1145411450
description: Whether to enable parallel tool calls.
11455-
default: true
1145611451
previous_response_id:
1145711452
anyOf:
1145811453
- type: string
@@ -11473,12 +11468,10 @@ components:
1147311468
type: boolean
1147411469
title: Store
1147511470
description: Whether to store the response in the database.
11476-
default: true
1147711471
stream:
1147811472
type: boolean
1147911473
title: Stream
1148011474
description: Whether to stream the response.
11481-
default: false
1148211475
temperature:
1148311476
anyOf:
1148411477
- type: number
@@ -13026,6 +13019,16 @@ components:
1302613019
- high
1302713020
- xhigh
1302813021
- type: 'null'
13022+
generate_summary:
13023+
anyOf:
13024+
- type: string
13025+
enum:
13026+
- auto
13027+
- concise
13028+
- detailed
13029+
- type: 'null'
13030+
description: "Deprecated: use 'summary' instead."
13031+
deprecated: true
1302913032
summary:
1303013033
anyOf:
1303113034
- type: string
@@ -13309,8 +13312,6 @@ components:
1330913312
type: boolean
1331013313
title: Include Obfuscation
1331113314
description: Whether to obfuscate sensitive information in streamed output.
13312-
default: true
13313-
additionalProperties: false
1331413315
type: object
1331513316
title: ResponseStreamOptions
1331613317
description: Options that control streamed response behavior.

docs/docs/api-openai/conformance.mdx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ This documentation is auto-generated from the OpenAI API specification compariso
1818

1919
| Metric | Value |
2020
|--------|-------|
21-
| **Overall Conformance Score** | 92.2% |
21+
| **Overall Conformance Score** | 92.3% |
2222
| **Endpoints Implemented** | 30/146 |
2323
| **Total Properties Checked** | 3487 |
24-
| **Schema/Type Issues** | 173 |
24+
| **Schema/Type Issues** | 169 |
2525
| **Missing Properties** | 98 |
26-
| **Total Issues to Fix** | 271 |
26+
| **Total Issues to Fix** | 267 |
2727

2828
## Integration Test Coverage
2929

@@ -49,7 +49,7 @@ Categories are sorted by conformance score (lowest first, needing most attention
4949
| Completions | 58.7% | 46 | 17 | 2 |
5050
| Embeddings | 78.6% | 14 | 3 | 0 |
5151
| Vector stores | 82.9% | 310 | 41 | 12 |
52-
| Responses | 88.9% | 225 | 25 | 0 |
52+
| Responses | 90.7% | 225 | 21 | 0 |
5353
| Files | 92.9% | 42 | 1 | 2 |
5454
| Models | 93.3% | 15 | 1 | 0 |
5555
| Chat | 98.7% | 449 | 5 | 1 |
@@ -732,24 +732,21 @@ Below is a detailed breakdown of conformance issues and missing properties for e
732732

733733
### Responses
734734

735-
**Score:** 88.9% · **Issues:** 25 · **Missing:** 0
735+
**Score:** 90.7% · **Issues:** 21 · **Missing:** 0
736736

737737
#### `/responses`
738738

739739
**POST**
740740

741741
<details>
742-
<summary>Schema Issues (22)</summary>
742+
<summary>Schema Issues (18)</summary>
743743

744744
| Property | Issues | Tested |
745745
|----------|--------|--------|
746746
| `requestBody.content.application/json.properties.input` | Union variants added: 2; Union variants removed: 2 | Yes |
747747
| `requestBody.content.application/json.properties.model` | Type added: ['string']; Nullable removed (OpenAI nullable); Union variants removed: 2 | Yes |
748-
| `requestBody.content.application/json.properties.parallel_tool_calls` | Default changed: None -&gt; True | Yes |
749748
| `requestBody.content.application/json.properties.reasoning` | Union variants added: 1; Union variants removed: 1 | Yes |
750749
| `requestBody.content.application/json.properties.service_tier` | Union variants added: 2 | Yes |
751-
| `requestBody.content.application/json.properties.store` | Default changed: None -&gt; True | Yes |
752-
| `requestBody.content.application/json.properties.stream` | Default changed: None -&gt; False | Yes |
753750
| `requestBody.content.application/json.properties.stream_options` | Union variants added: 1; Union variants removed: 1 | No |
754751
| `requestBody.content.application/json.properties.text` | Union variants added: 1; Union variants removed: 1 | No |
755752
| `requestBody.content.application/json.properties.tool_choice` | Union variants added: 2; Union variants removed: 1 | Yes |
@@ -758,9 +755,8 @@ Below is a detailed breakdown of conformance issues and missing properties for e
758755
| `responses.200.content.application/json.properties.incomplete_details` | Union variants added: 1; Union variants removed: 1 | Yes |
759756
| `responses.200.content.application/json.properties.metadata` | Union variants added: 2 | Yes |
760757
| `responses.200.content.application/json.properties.output.items` | Union variants added: 8; Union variants removed: 4 | Yes |
761-
| `responses.200.content.application/json.properties.parallel_tool_calls` | Default changed: None -&gt; True | Yes |
762758
| `responses.200.content.application/json.properties.reasoning` | Union variants added: 1; Union variants removed: 1 | Yes |
763-
| `responses.200.content.application/json.properties.text` | Type added: ['object']; Default changed: None -&gt; \{'format': \{'type': 'text'\}\} | No |
759+
| `responses.200.content.application/json.properties.text` | Type added: ['object'] | No |
764760
| `responses.200.content.application/json.properties.tool_choice` | Union variants added: 3 | Yes |
765761
| `responses.200.content.application/json.properties.tools.items` | Union variants added: 4; Union variants removed: 1 | Yes |
766762
| `responses.200.content.application/json.properties.truncation` | Union variants added: 2 | Yes |

docs/static/deprecated-ogx-spec.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,7 +3447,6 @@ components:
34473447
parallel_tool_calls:
34483448
type: boolean
34493449
title: Parallel Tool Calls
3450-
default: true
34513450
previous_response_id:
34523451
anyOf:
34533452
- type: string
@@ -3470,9 +3469,6 @@ components:
34703469
title: Temperature
34713470
text:
34723471
$ref: '#/components/schemas/OpenAIResponseText'
3473-
default:
3474-
format:
3475-
type: text
34763472
top_p:
34773473
type: number
34783474
title: Top P
@@ -3537,8 +3533,10 @@ components:
35373533
title: OpenAIResponseInputToolChoiceMode
35383534
truncation:
35393535
anyOf:
3540-
- type: string
3536+
- $ref: '#/components/schemas/ResponseTruncation'
3537+
title: ResponseTruncation
35413538
- type: 'null'
3539+
title: ResponseTruncation
35423540
usage:
35433541
anyOf:
35443542
- $ref: '#/components/schemas/OpenAIResponseUsage'
@@ -3872,7 +3870,6 @@ components:
38723870
parallel_tool_calls:
38733871
type: boolean
38743872
title: Parallel Tool Calls
3875-
default: true
38763873
previous_response_id:
38773874
anyOf:
38783875
- type: string
@@ -3895,9 +3892,6 @@ components:
38953892
title: Temperature
38963893
text:
38973894
$ref: '#/components/schemas/OpenAIResponseText'
3898-
default:
3899-
format:
3900-
type: text
39013895
top_p:
39023896
type: number
39033897
title: Top P
@@ -3962,8 +3956,10 @@ components:
39623956
title: OpenAIResponseInputToolChoiceMode
39633957
truncation:
39643958
anyOf:
3965-
- type: string
3959+
- $ref: '#/components/schemas/ResponseTruncation'
3960+
title: ResponseTruncation
39663961
- type: 'null'
3962+
title: ResponseTruncation
39673963
usage:
39683964
anyOf:
39693965
- $ref: '#/components/schemas/OpenAIResponseUsage'
@@ -7947,6 +7943,16 @@ components:
79477943
- high
79487944
- xhigh
79497945
- type: 'null'
7946+
generate_summary:
7947+
anyOf:
7948+
- type: string
7949+
enum:
7950+
- auto
7951+
- concise
7952+
- detailed
7953+
- type: 'null'
7954+
description: "Deprecated: use 'summary' instead."
7955+
deprecated: true
79507956
summary:
79517957
anyOf:
79527958
- type: string
@@ -8212,6 +8218,13 @@ components:
82128218
82138219
Returns a list of chunks ready for storage in vector databases.
82148220
Each chunk contains the content and metadata.
8221+
ResponseTruncation:
8222+
type: string
8223+
enum:
8224+
- auto
8225+
- disabled
8226+
title: ResponseTruncation
8227+
description: Controls how the service truncates input when it exceeds the model context window.
82158228
SearchRankingOptions:
82168229
properties:
82178230
ranker:

docs/static/experimental-ogx-spec.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3729,7 +3729,6 @@ components:
37293729
parallel_tool_calls:
37303730
type: boolean
37313731
title: Parallel Tool Calls
3732-
default: true
37333732
previous_response_id:
37343733
anyOf:
37353734
- type: string
@@ -3752,9 +3751,6 @@ components:
37523751
title: Temperature
37533752
text:
37543753
$ref: '#/components/schemas/OpenAIResponseText'
3755-
default:
3756-
format:
3757-
type: text
37583754
top_p:
37593755
type: number
37603756
title: Top P
@@ -3819,8 +3815,10 @@ components:
38193815
title: OpenAIResponseInputToolChoiceMode
38203816
truncation:
38213817
anyOf:
3822-
- type: string
3818+
- $ref: '#/components/schemas/ResponseTruncation'
3819+
title: ResponseTruncation
38233820
- type: 'null'
3821+
title: ResponseTruncation
38243822
usage:
38253823
anyOf:
38263824
- $ref: '#/components/schemas/OpenAIResponseUsage'
@@ -4154,7 +4152,6 @@ components:
41544152
parallel_tool_calls:
41554153
type: boolean
41564154
title: Parallel Tool Calls
4157-
default: true
41584155
previous_response_id:
41594156
anyOf:
41604157
- type: string
@@ -4177,9 +4174,6 @@ components:
41774174
title: Temperature
41784175
text:
41794176
$ref: '#/components/schemas/OpenAIResponseText'
4180-
default:
4181-
format:
4182-
type: text
41834177
top_p:
41844178
type: number
41854179
title: Top P
@@ -4244,8 +4238,10 @@ components:
42444238
title: OpenAIResponseInputToolChoiceMode
42454239
truncation:
42464240
anyOf:
4247-
- type: string
4241+
- $ref: '#/components/schemas/ResponseTruncation'
4242+
title: ResponseTruncation
42484243
- type: 'null'
4244+
title: ResponseTruncation
42494245
usage:
42504246
anyOf:
42514247
- $ref: '#/components/schemas/OpenAIResponseUsage'
@@ -8632,6 +8628,16 @@ components:
86328628
- high
86338629
- xhigh
86348630
- type: 'null'
8631+
generate_summary:
8632+
anyOf:
8633+
- type: string
8634+
enum:
8635+
- auto
8636+
- concise
8637+
- detailed
8638+
- type: 'null'
8639+
description: "Deprecated: use 'summary' instead."
8640+
deprecated: true
86358641
summary:
86368642
anyOf:
86378643
- type: string
@@ -8897,6 +8903,13 @@ components:
88978903
88988904
Returns a list of chunks ready for storage in vector databases.
88998905
Each chunk contains the content and metadata.
8906+
ResponseTruncation:
8907+
type: string
8908+
enum:
8909+
- auto
8910+
- disabled
8911+
title: ResponseTruncation
8912+
description: Controls how the service truncates input when it exceeds the model context window.
89008913
SearchRankingOptions:
89018914
properties:
89028915
ranker:

0 commit comments

Comments
 (0)