Skip to content

Commit 0f8b121

Browse files
authored
fix: api-patches.yaml (#65)
1 parent 7785b39 commit 0f8b121

File tree

4 files changed

+1460
-422
lines changed

4 files changed

+1460
-422
lines changed

internal/apiclient/api-original.yaml

Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4025,11 +4025,6 @@ paths:
40254025
application/json:
40264026
schema:
40274027
$ref: "#/components/schemas/ApiKeyList"
4028-
security:
4029-
- bearer_identity_edge:
4030-
- key.secret
4031-
- api.management.read
4032-
- basic_identity_edge: []
40334028
x-oaiMeta:
40344029
name: List admin API keys
40354030
group: administration
@@ -4089,11 +4084,6 @@ paths:
40894084
application/json:
40904085
schema:
40914086
$ref: "#/components/schemas/AdminApiKey"
4092-
security:
4093-
- bearer_identity_edge:
4094-
- key.secret
4095-
- api.management.write
4096-
- basic_identity_edge: []
40974087
x-oaiMeta:
40984088
name: Create admin API key
40994089
group: administration
@@ -4144,11 +4134,6 @@ paths:
41444134
application/json:
41454135
schema:
41464136
$ref: "#/components/schemas/AdminApiKey"
4147-
security:
4148-
- bearer_identity_edge:
4149-
- key.secret
4150-
- api.management.read
4151-
- basic_identity_edge: []
41524137
x-oaiMeta:
41534138
name: Retrieve admin API key
41544139
group: administration
@@ -4204,11 +4189,6 @@ paths:
42044189
deleted:
42054190
type: boolean
42064191
example: true
4207-
security:
4208-
- bearer_identity_edge:
4209-
- key.secret
4210-
- api.management.write
4211-
- basic_identity_edge: []
42124192
x-oaiMeta:
42134193
name: Delete admin API key
42144194
group: administration
@@ -11701,8 +11681,9 @@ components:
1170111681

1170211682
We generally recommend altering this or temperature but not both.
1170311683
response_format:
11704-
$ref: "#/components/schemas/AssistantsApiResponseFormatOption"
11705-
nullable: true
11684+
allOf:
11685+
- $ref: "#/components/schemas/AssistantsApiResponseFormatOption"
11686+
- nullable: true
1170611687
required:
1170711688
- id
1170811689
- object
@@ -12298,10 +12279,8 @@ components:
1229812279
- session
1229912280
- api_key
1230012281
session:
12301-
type: object
1230212282
$ref: "#/components/schemas/AuditLogActorSession"
1230312283
api_key:
12304-
type: object
1230512284
$ref: "#/components/schemas/AuditLogActorApiKey"
1230612285
AuditLogActorApiKey:
1230712286
type: object
@@ -13722,8 +13701,9 @@ components:
1372213701

1372313702
We generally recommend altering this or temperature but not both.
1372413703
response_format:
13725-
$ref: "#/components/schemas/AssistantsApiResponseFormatOption"
13726-
nullable: true
13704+
allOf:
13705+
- $ref: "#/components/schemas/AssistantsApiResponseFormatOption"
13706+
- nullable: true
1372713707
required:
1372813708
- model
1372913709
CreateChatCompletionFunctionResponse:
@@ -16299,16 +16279,19 @@ components:
1629916279
for more info.
1630016280
minimum: 256
1630116281
truncation_strategy:
16302-
$ref: "#/components/schemas/TruncationObject"
16303-
nullable: true
16282+
allOf:
16283+
- $ref: "#/components/schemas/TruncationObject"
16284+
- nullable: true
1630416285
tool_choice:
16305-
$ref: "#/components/schemas/AssistantsApiToolChoiceOption"
16306-
nullable: true
16286+
allOf:
16287+
- $ref: "#/components/schemas/AssistantsApiToolChoiceOption"
16288+
- nullable: true
1630716289
parallel_tool_calls:
1630816290
$ref: "#/components/schemas/ParallelToolCalls"
1630916291
response_format:
16310-
$ref: "#/components/schemas/AssistantsApiResponseFormatOption"
16311-
nullable: true
16292+
allOf:
16293+
- $ref: "#/components/schemas/AssistantsApiResponseFormatOption"
16294+
- nullable: true
1631216295
required:
1631316296
- assistant_id
1631416297
CreateSpeechRequest:
@@ -16380,7 +16363,6 @@ components:
1638016363
type: string
1638116364
thread:
1638216365
$ref: "#/components/schemas/CreateThreadRequest"
16383-
description: If no thread is provided, an empty thread will be created.
1638416366
model:
1638516367
description: The ID of the [Model](/docs/api-reference/models) to be used to
1638616368
execute this run. If a value is provided here, it will override the
@@ -16532,20 +16514,26 @@ components:
1653216514
for more info.
1653316515
minimum: 256
1653416516
truncation_strategy:
16535-
$ref: "#/components/schemas/TruncationObject"
16536-
nullable: true
16517+
allOf:
16518+
- $ref: "#/components/schemas/TruncationObject"
16519+
- nullable: true
1653716520
tool_choice:
16538-
$ref: "#/components/schemas/AssistantsApiToolChoiceOption"
16539-
nullable: true
16521+
allOf:
16522+
- $ref: "#/components/schemas/AssistantsApiToolChoiceOption"
16523+
- nullable: true
1654016524
parallel_tool_calls:
1654116525
$ref: "#/components/schemas/ParallelToolCalls"
1654216526
response_format:
16543-
$ref: "#/components/schemas/AssistantsApiResponseFormatOption"
16544-
nullable: true
16527+
allOf:
16528+
- $ref: "#/components/schemas/AssistantsApiResponseFormatOption"
16529+
- nullable: true
1654516530
required:
1654616531
- assistant_id
1654716532
CreateThreadRequest:
1654816533
type: object
16534+
description: |
16535+
Options to create a new thread. If no thread is provided when running a
16536+
request, an empty thread will be created.
1654916537
additionalProperties: false
1655016538
properties:
1655116539
messages:
@@ -17429,10 +17417,8 @@ components:
1742917417
- supervised
1743017418
- dpo
1743117419
supervised:
17432-
type: object
1743317420
$ref: "#/components/schemas/FineTuneSupervisedMethod"
1743417421
dpo:
17435-
type: object
1743617422
$ref: "#/components/schemas/FineTuneDPOMethod"
1743717423
FineTunePreferenceRequestInput:
1743817424
type: object
@@ -18926,8 +18912,7 @@ components:
1892618912
type: array
1892718913
items:
1892818914
oneOf:
18929-
- $ref: "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObjec\
18930-
t"
18915+
- $ref: "#/components/schemas/MessageDeltaContentTextAnnotationsFileCitationObject"
1893118916
- $ref: "#/components/schemas/MessageDeltaContentTextAnnotationsFilePathObject"
1893218917
x-oaiExpandable: true
1893318918
required:
@@ -19392,8 +19377,9 @@ components:
1939219377

1939319378
We generally recommend altering this or temperature but not both.
1939419379
response_format:
19395-
$ref: "#/components/schemas/AssistantsApiResponseFormatOption"
19396-
nullable: true
19380+
allOf:
19381+
- $ref: "#/components/schemas/AssistantsApiResponseFormatOption"
19382+
- nullable: true
1939719383
ModifyMessageRequest:
1939819384
type: object
1939919385
additionalProperties: false
@@ -23566,16 +23552,19 @@ components:
2356623552
over the course of the run.
2356723553
minimum: 256
2356823554
truncation_strategy:
23569-
$ref: "#/components/schemas/TruncationObject"
23570-
nullable: true
23555+
allOf:
23556+
- $ref: "#/components/schemas/TruncationObject"
23557+
- nullable: true
2357123558
tool_choice:
23572-
$ref: "#/components/schemas/AssistantsApiToolChoiceOption"
23573-
nullable: true
23559+
allOf:
23560+
- $ref: "#/components/schemas/AssistantsApiToolChoiceOption"
23561+
- nullable: true
2357423562
parallel_tool_calls:
2357523563
$ref: "#/components/schemas/ParallelToolCalls"
2357623564
response_format:
23577-
$ref: "#/components/schemas/AssistantsApiResponseFormatOption"
23578-
nullable: true
23565+
allOf:
23566+
- $ref: "#/components/schemas/AssistantsApiResponseFormatOption"
23567+
- nullable: true
2357923568
required:
2358023569
- id
2358123570
- object
@@ -24894,8 +24883,9 @@ components:
2489424883
type: string
2489524884
nullable: true
2489624885
expires_after:
24897-
$ref: "#/components/schemas/VectorStoreExpirationAfter"
24898-
nullable: true
24886+
allOf:
24887+
- $ref: "#/components/schemas/VectorStoreExpirationAfter"
24888+
- nullable: true
2489924889
metadata:
2490024890
description: >
2490124891
Set of 16 key-value pairs that can be attached to an object. This
@@ -24947,9 +24937,10 @@ components:
2494724937
- upload
2494824938
x-stainless-const: true
2494924939
file:
24950-
$ref: "#/components/schemas/OpenAIFile"
24951-
nullable: true
24952-
description: The ready File object after the Upload is completed.
24940+
allOf:
24941+
- $ref: "#/components/schemas/OpenAIFile"
24942+
- nullable: true
24943+
description: The ready File object after the Upload is completed.
2495324944
required:
2495424945
- bytes
2495524946
- created_at

internal/apiclient/api-patches.yaml

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,24 @@
1212

1313
#@ def fix_property(p):
1414
#@ p = dict(p)
15-
#@ if "type" in p and p["type"] == "integer":
15+
#@ if p.get("type") == "integer":
1616
#@ p["format"] = "int64"
1717
#@ end
18+
#@ if "allOf" in p and len(p["allOf"]) == 2 and "nullable" in p["allOf"][1]:
19+
#@ p["oneOf"] = p.pop("allOf")
20+
#@ end
1821
#@ return p
1922
#@ end
2023

21-
#@ def fix_properties(m):
24+
#@ def fix_schemas(m):
2225
#@ m = dict(m)
23-
#@ return {k: fix_property(dict(v)) for k, v in m.items()}
26+
#@ for k, v in m.items():
27+
#@ m[k] = dict(v)
28+
#@ if "properties" in m[k]:
29+
#@ m[k]["properties"] = dict({k: fix_property(v) for k, v in dict(m[k]["properties"]).items()})
30+
#@ end
31+
#@ end
32+
#@ return m
2433
#@ end
2534

2635
paths:
@@ -38,40 +47,20 @@ paths:
3847
type: string
3948
/organization/invites:
4049
post:
41-
#@overlay/replace via=lambda left, right: rename_property(left, "200", "201")
50+
#@overlay/replace via=lambda left, _: rename_property(left, "200", "201")
4251
responses:
4352
/organization/projects:
4453
post:
45-
#@overlay/replace via=lambda left, right: rename_property(left, "200", "201")
54+
#@overlay/replace via=lambda left, _: rename_property(left, "200", "201")
4655
responses:
4756
/organization/projects/{project_id}/users:
4857
post:
49-
#@overlay/replace via=lambda left, right: rename_property(left, "200", "201")
58+
#@overlay/replace via=lambda left, _: rename_property(left, "200", "201")
5059
responses:
5160
/organization/projects/{project_id}/service_accounts:
5261
post:
53-
#@overlay/replace via=lambda left, right: rename_property(left, "200", "201")
62+
#@overlay/replace via=lambda left, _: rename_property(left, "200", "201")
5463
responses:
5564
components:
65+
#@overlay/replace via=lambda left, _: fix_schemas(left)
5666
schemas:
57-
Invite:
58-
#@overlay/replace via=lambda left, right: fix_properties(dict(left))
59-
properties:
60-
Project:
61-
#@overlay/replace via=lambda left, right: fix_properties(dict(left))
62-
properties:
63-
ProjectRateLimitUpdateRequest:
64-
#@overlay/replace via=lambda left, right: fix_properties(dict(left))
65-
properties:
66-
ProjectRateLimit:
67-
#@overlay/replace via=lambda left, right: fix_properties(dict(left))
68-
properties:
69-
ProjectServiceAccount:
70-
#@overlay/replace via=lambda left, right: fix_properties(dict(left))
71-
properties:
72-
ProjectServiceAccountCreateResponse:
73-
#@overlay/replace via=lambda left, right: fix_properties(dict(left))
74-
properties:
75-
User:
76-
#@overlay/replace via=lambda left, right: fix_properties(dict(left))
77-
properties:

0 commit comments

Comments
 (0)