Skip to content

Commit 8b414d2

Browse files
feat(api): support Responses WebSocket warmup and local parsing
Castiron-Internal-PR: openai/openai-python-internal#387 Castiron-Source-SHA: 23639b55f961a781c648a7ca87fbe57660295116 Castiron-Public-Base-SHA: 85bb536
1 parent 85bb536 commit 8b414d2

15 files changed

Lines changed: 138 additions & 30 deletions

File tree

‎.castiron.stats.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schema_version: 1
2-
generation_id: 65a0f13e-756e-4f10-b075-12ae5d3d27a9
3-
openapi_spec_hash: 51b199ef7fd5542bc4910765f9becd60
4-
openapi_transformed_spec_hash: 73822d924c15a6ed58dcfe8f616bd4be
2+
generation_id: 287e1fa6-451c-4f5f-9a80-498c77a0bd65
3+
openapi_spec_hash: 17689beb6a2da96f6cf9e5ac1e758a99
4+
openapi_transformed_spec_hash: 75a7f7b19910025d8f8f8aa1556d9b69
55
config_hash: b707b209c892562880c415693d111ad6
6-
codegen_sha: 52c5bafacb27ede81a3d66b62b29d946df4ed2cd
7-
codegen_hash: 536c408e94523f4af5a3ddf0c2f8f0764014bad6b9287cacdb9b8e3eeb60ba7d
6+
codegen_sha: b79c2ec277007e5a097e73a710864b77338da840
7+
codegen_hash: 7acc6ff9d93bbfd3be9e38f79d6b509bfd063f80cdd751f997b86e000327b9ae

‎api_reference/openapi.transformed.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68596,6 +68596,12 @@ components:
6859668596
`stream_id` controls routing; `previous_response_id` controls
6859768597
conversation lineage, so a new lane can fork from a response created
6859868598
on another lane.
68599+
generate:
68600+
type: boolean
68601+
description: |
68602+
Whether to generate output for this response. Defaults to true when omitted.
68603+
Set to false to prepare request state without model output; the response
68604+
ID can be used as previous_response_id on a later turn.
6859968605
required:
6860068606
- type
6860168607
- $ref: '#/components/schemas/CreateResponse'
@@ -111544,6 +111550,12 @@ components:
111544111550
`stream_id` controls routing; `previous_response_id` controls
111545111551
conversation lineage, so a new lane can fork from a response created
111546111552
on another lane.
111553+
generate:
111554+
type: boolean
111555+
description: |
111556+
Whether to generate output for this response. Defaults to true when omitted.
111557+
Set to false to prepare request state without model output; the response
111558+
ID can be used as previous_response_id on a later turn.
111547111559
required:
111548111560
- type
111549111561
- $ref: '#/components/schemas/BetaCreateResponse'

‎scripts/castiron/generated-files.json‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
},
380380
"src/openai/resources/beta/responses/responses.py": {
381381
"mode": "100644",
382-
"sha256": "effa8db6d9a676f1f264f0b6acb3252d8dcd5f75db251bfd8b5d45ea49f0f533"
382+
"sha256": "c5a3b0cb69c3f990dc2ae76db0d2c5fb2df54b8fc312d330cb33d223d1389d26"
383383
},
384384
"src/openai/resources/beta/threads/__init__.py": {
385385
"mode": "100644",
@@ -559,19 +559,19 @@
559559
},
560560
"src/openai/resources/live/forks.py": {
561561
"mode": "100644",
562-
"sha256": "7fe78c144680df54628773683f9dd5b06c5241d0218b4f4c745890ddae225c92"
562+
"sha256": "f65742e893b6af599b97156ed30e80629364a4cf74fa76593c26b845c4fd6a1b"
563563
},
564564
"src/openai/resources/live/live.py": {
565565
"mode": "100644",
566-
"sha256": "86be3e074d011a750fa52a4d216a7e87ee5c8e82f6ccec00102c03a539199882"
566+
"sha256": "4f9a3128d0a4d56f14c74c80a1d6bb8ee76fdb8096699f6573bc6c4ed434b9d6"
567567
},
568568
"src/openai/resources/live/sessions.py": {
569569
"mode": "100644",
570570
"sha256": "9ba2d59d9c7498c96ac2e7e48660c91468e0eeb5df881e77f123ee37985c3dfd"
571571
},
572572
"src/openai/resources/live/sideband.py": {
573573
"mode": "100644",
574-
"sha256": "d19149c042afcd8c8efca3d7794092acc1c2f76a4bcb4f6f620547314a78e59b"
574+
"sha256": "57b9f15595dc68614203c5c0fa4c92f309e27a90f927a0cf8e46542cfa3eb79b"
575575
},
576576
"src/openai/resources/models.py": {
577577
"mode": "100644",
@@ -599,7 +599,7 @@
599599
},
600600
"src/openai/resources/realtime/realtime.py": {
601601
"mode": "100644",
602-
"sha256": "9cb69e1f54c6e21d9111ddfb59a2a4de18466a1a86487fc65a0e17224b72475e"
602+
"sha256": "57a32212a3d102145e054727e00c979b616b38d85a2802761dd2f6c2848a0db1"
603603
},
604604
"src/openai/resources/realtime/translations/__init__.py": {
605605
"mode": "100644",
@@ -611,7 +611,7 @@
611611
},
612612
"src/openai/resources/realtime/translations/translations.py": {
613613
"mode": "100644",
614-
"sha256": "4a6f072cea78d5afab3fe1c995b939ff8c79f449665346c729abb5c516c53f21"
614+
"sha256": "dd26ca4fe27aa6b23b9d0add6e5aa41d10379ee3c6fa8c22293a26da867ca90e"
615615
},
616616
"src/openai/resources/responses/__init__.py": {
617617
"mode": "100644",
@@ -631,7 +631,7 @@
631631
},
632632
"src/openai/resources/responses/responses.py": {
633633
"mode": "100644",
634-
"sha256": "f844db6ec37b49de883ab2c507570b94c29e8c2609ee93cf45c0aec19fd671d3"
634+
"sha256": "86130a834c60c1b7df85118cbc918e84d0a23c122099f1f4e931c1a39b35abfa"
635635
},
636636
"src/openai/resources/safety/__init__.py": {
637637
"mode": "100644",
@@ -3087,11 +3087,11 @@
30873087
},
30883088
"src/openai/types/beta/beta_responses_client_event.py": {
30893089
"mode": "100644",
3090-
"sha256": "939052a456df5a661ed334033a9151c18ed63dfba6c520fd92a7572d50efc091"
3090+
"sha256": "977d2d22d8468005d9dcf27c5e9c7e5c6430bb9dacd5258369022f1513431d3d"
30913091
},
30923092
"src/openai/types/beta/beta_responses_client_event_param.py": {
30933093
"mode": "100644",
3094-
"sha256": "ba2e2d06061761345308086b4b1d2ce39f86db631c46db825c5bbc7f62f63ccb"
3094+
"sha256": "0ad4be42df7202197e66ed97ae6fbfbdcad2aeb4e92328064630497d18fb457c"
30953095
},
30963096
"src/openai/types/beta/beta_responses_server_event.py": {
30973097
"mode": "100644",
@@ -6735,11 +6735,11 @@
67356735
},
67366736
"src/openai/types/responses/responses_client_event.py": {
67376737
"mode": "100644",
6738-
"sha256": "77d64183c9c69abfd4300c8094fbd3bc9c3a89743b9efa83a5264bd3dc165961"
6738+
"sha256": "3993eec234392a96646408fb959860a86b2711ac53dc7e8ae1338c43ca6383b4"
67396739
},
67406740
"src/openai/types/responses/responses_client_event_param.py": {
67416741
"mode": "100644",
6742-
"sha256": "95444697e02d702e9f568da381903d251b3d5c649de9c5d26662a1782431647b"
6742+
"sha256": "20cbab38d02cfd2506ad2104d09e2b3bfb0d2b0d8a55adec13882f3a15c9db2d"
67436743
},
67446744
"src/openai/types/responses/responses_server_event.py": {
67456745
"mode": "100644",

‎src/openai/resources/beta/responses/responses.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5278,7 +5278,7 @@ async def __aexit__(
52785278
if self.__connection is not None:
52795279
try:
52805280
await self.__connection.close()
5281-
except BaseException:
5281+
except Exception:
52825282
if exc is None:
52835283
raise
52845284

@@ -5696,7 +5696,7 @@ def __exit__(
56965696
if self.__connection is not None:
56975697
try:
56985698
self.__connection.close()
5699-
except BaseException:
5699+
except Exception:
57005700
if exc is None:
57015701
raise
57025702

@@ -5715,6 +5715,7 @@ def create(
57155715
context_management: Optional[Iterable[beta_responses_client_event_param.ResponseCreateContextManagement]]
57165716
| Omit = omit,
57175717
conversation: Optional[beta_responses_client_event_param.ResponseCreateConversation] | Omit = omit,
5718+
generate: bool | Omit = omit,
57185719
include: Optional[List[BetaResponseIncludable]] | Omit = omit,
57195720
input: Union[str, BetaResponseInputParam] | Omit = omit,
57205721
instructions: Optional[str] | Omit = omit,
@@ -5881,6 +5882,7 @@ def create(
58815882
"background": background,
58825883
"context_management": context_management,
58835884
"conversation": conversation,
5885+
"generate": generate,
58845886
"include": include,
58855887
"input": input,
58865888
"instructions": instructions,
@@ -5973,6 +5975,7 @@ async def create(
59735975
context_management: Optional[Iterable[beta_responses_client_event_param.ResponseCreateContextManagement]]
59745976
| Omit = omit,
59755977
conversation: Optional[beta_responses_client_event_param.ResponseCreateConversation] | Omit = omit,
5978+
generate: bool | Omit = omit,
59765979
include: Optional[List[BetaResponseIncludable]] | Omit = omit,
59775980
input: Union[str, BetaResponseInputParam] | Omit = omit,
59785981
instructions: Optional[str] | Omit = omit,
@@ -6139,6 +6142,7 @@ async def create(
61396142
"background": background,
61406143
"context_management": context_management,
61416144
"conversation": conversation,
6145+
"generate": generate,
61426146
"include": include,
61436147
"input": input,
61446148
"instructions": instructions,

‎src/openai/resources/live/forks.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ async def __aexit__(
533533
if self.__connection is not None:
534534
try:
535535
await self.__connection.close()
536-
except BaseException:
536+
except Exception:
537537
if exc is None:
538538
raise
539539

@@ -959,7 +959,7 @@ def __exit__(
959959
if self.__connection is not None:
960960
try:
961961
self.__connection.close()
962-
except BaseException:
962+
except Exception:
963963
if exc is None:
964964
raise
965965

‎src/openai/resources/live/live.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ async def __aexit__(
746746
if self.__connection is not None:
747747
try:
748748
await self.__connection.close()
749-
except BaseException:
749+
except Exception:
750750
if exc is None:
751751
raise
752752

@@ -1164,7 +1164,7 @@ def __exit__(
11641164
if self.__connection is not None:
11651165
try:
11661166
self.__connection.close()
1167-
except BaseException:
1167+
except Exception:
11681168
if exc is None:
11691169
raise
11701170

‎src/openai/resources/live/sideband.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ async def __aexit__(
545545
if self.__connection is not None:
546546
try:
547547
await self.__connection.close()
548-
except BaseException:
548+
except Exception:
549549
if exc is None:
550550
raise
551551

@@ -980,7 +980,7 @@ def __exit__(
980980
if self.__connection is not None:
981981
try:
982982
self.__connection.close()
983-
except BaseException:
983+
except Exception:
984984
if exc is None:
985985
raise
986986

‎src/openai/resources/realtime/realtime.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ async def __aexit__(
756756
if self.__connection is not None:
757757
try:
758758
await self.__connection.close()
759-
except BaseException:
759+
except Exception:
760760
if exc is None:
761761
raise
762762

@@ -1213,7 +1213,7 @@ def __exit__(
12131213
if self.__connection is not None:
12141214
try:
12151215
self.__connection.close()
1216-
except BaseException:
1216+
except Exception:
12171217
if exc is None:
12181218
raise
12191219

‎src/openai/resources/realtime/translations/translations.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ async def __aexit__(
617617
if self.__connection is not None:
618618
try:
619619
await self.__connection.close()
620-
except BaseException:
620+
except Exception:
621621
if exc is None:
622622
raise
623623

@@ -1041,7 +1041,7 @@ def __exit__(
10411041
if self.__connection is not None:
10421042
try:
10431043
self.__connection.close()
1044-
except BaseException:
1044+
except Exception:
10451045
if exc is None:
10461046
raise
10471047

‎src/openai/resources/responses/responses.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4467,7 +4467,7 @@ async def __aexit__(
44674467
if self.__connection is not None:
44684468
try:
44694469
await self.__connection.close()
4470-
except BaseException:
4470+
except Exception:
44714471
if exc is None:
44724472
raise
44734473

@@ -4886,7 +4886,7 @@ def __exit__(
48864886
if self.__connection is not None:
48874887
try:
48884888
self.__connection.close()
4889-
except BaseException:
4889+
except Exception:
48904890
if exc is None:
48914891
raise
48924892

@@ -4939,6 +4939,7 @@ def create(
49394939
context_management: Optional[Iterable[responses_client_event_param.ResponseCreateContextManagement]]
49404940
| Omit = omit,
49414941
conversation: Optional[responses_client_event_param.ResponseCreateConversation] | Omit = omit,
4942+
generate: bool | Omit = omit,
49424943
include: Optional[List[ResponseIncludable]] | Omit = omit,
49434944
input: Union[str, ResponseInputParam] | Omit = omit,
49444945
instructions: Optional[str] | Omit = omit,
@@ -4989,6 +4990,7 @@ def create(
49894990
"background": background,
49904991
"context_management": context_management,
49914992
"conversation": conversation,
4993+
"generate": generate,
49924994
"include": include,
49934995
"input": input,
49944996
"instructions": instructions,
@@ -5074,6 +5076,7 @@ async def create(
50745076
context_management: Optional[Iterable[responses_client_event_param.ResponseCreateContextManagement]]
50755077
| Omit = omit,
50765078
conversation: Optional[responses_client_event_param.ResponseCreateConversation] | Omit = omit,
5079+
generate: bool | Omit = omit,
50775080
include: Optional[List[ResponseIncludable]] | Omit = omit,
50785081
input: Union[str, ResponseInputParam] | Omit = omit,
50795082
instructions: Optional[str] | Omit = omit,
@@ -5124,6 +5127,7 @@ async def create(
51245127
"background": background,
51255128
"context_management": context_management,
51265129
"conversation": conversation,
5130+
"generate": generate,
51275131
"include": include,
51285132
"input": input,
51295133
"instructions": instructions,

0 commit comments

Comments
 (0)