@@ -41,6 +41,28 @@ class StructuredResponseOutputItem<T : Any>(
4141 /* * @see ResponseOutputItem.reasoning */
4242 fun reasoning (): Optional <ResponseReasoningItem > = rawOutputItem.reasoning()
4343
44+ /* * @see ResponseOutputItem.codeInterpreterCall */
45+ fun codeInterpreterCall (): Optional <ResponseCodeInterpreterToolCall > =
46+ rawOutputItem.codeInterpreterCall()
47+
48+ /* * @see ResponseOutputItem.imageGenerationCall */
49+ fun imageGenerationCall (): Optional <ResponseOutputItem .ImageGenerationCall > =
50+ rawOutputItem.imageGenerationCall()
51+
52+ /* * @see ResponseOutputItem.localShellCall */
53+ fun localShellCall (): Optional <ResponseOutputItem .LocalShellCall > =
54+ rawOutputItem.localShellCall()
55+
56+ /* * @see ResponseOutputItem.mcpApprovalRequest */
57+ fun mcpApprovalRequest (): Optional <ResponseOutputItem .McpApprovalRequest > =
58+ rawOutputItem.mcpApprovalRequest()
59+
60+ /* * @see ResponseOutputItem.mcpCall */
61+ fun mcpCall (): Optional <ResponseOutputItem .McpCall > = rawOutputItem.mcpCall()
62+
63+ /* * @see ResponseOutputItem.mcpListTools */
64+ fun mcpListTools (): Optional <ResponseOutputItem .McpListTools > = rawOutputItem.mcpListTools()
65+
4466 /* * @see ResponseOutputItem.isMessage */
4567 fun isMessage (): Boolean = message().isPresent
4668
@@ -59,6 +81,24 @@ class StructuredResponseOutputItem<T : Any>(
5981 /* * @see ResponseOutputItem.isReasoning */
6082 fun isReasoning (): Boolean = rawOutputItem.isReasoning()
6183
84+ /* * @see ResponseOutputItem.isCodeInterpreterCall */
85+ fun isCodeInterpreterCall (): Boolean = rawOutputItem.isCodeInterpreterCall()
86+
87+ /* * @see ResponseOutputItem.isImageGenerationCall */
88+ fun isImageGenerationCall (): Boolean = rawOutputItem.isImageGenerationCall()
89+
90+ /* * @see ResponseOutputItem.isLocalShellCall */
91+ fun isLocalShellCall (): Boolean = rawOutputItem.isLocalShellCall()
92+
93+ /* * @see ResponseOutputItem.isMcpApprovalRequest */
94+ fun isMcpApprovalRequest (): Boolean = rawOutputItem.isMcpApprovalRequest()
95+
96+ /* * @see ResponseOutputItem.isMcpCall */
97+ fun isMcpCall (): Boolean = rawOutputItem.isMcpCall()
98+
99+ /* * @see ResponseOutputItem.isMcpListTools */
100+ fun isMcpListTools (): Boolean = rawOutputItem.isMcpListTools()
101+
62102 /* * @see ResponseOutputItem.asMessage */
63103 fun asMessage (): StructuredResponseOutputMessage <T > =
64104 message.getOrElse {
@@ -81,6 +121,27 @@ class StructuredResponseOutputItem<T : Any>(
81121 /* * @see ResponseOutputItem.asReasoning */
82122 fun asReasoning (): ResponseReasoningItem = rawOutputItem.asReasoning()
83123
124+ /* * @see ResponseOutputItem.asCodeInterpreterCall */
125+ fun asCodeInterpreterCall (): ResponseCodeInterpreterToolCall =
126+ rawOutputItem.asCodeInterpreterCall()
127+
128+ /* * @see ResponseOutputItem.asImageGenerationCall */
129+ fun asImageGenerationCall (): ResponseOutputItem .ImageGenerationCall =
130+ rawOutputItem.asImageGenerationCall()
131+
132+ /* * @see ResponseOutputItem.asLocalShellCall */
133+ fun asLocalShellCall (): ResponseOutputItem .LocalShellCall = rawOutputItem.asLocalShellCall()
134+
135+ /* * @see ResponseOutputItem.asMcpApprovalRequest */
136+ fun asMcpApprovalRequest (): ResponseOutputItem .McpApprovalRequest =
137+ rawOutputItem.asMcpApprovalRequest()
138+
139+ /* * @see ResponseOutputItem.asMcpCall */
140+ fun asMcpCall (): ResponseOutputItem .McpCall = rawOutputItem.asMcpCall()
141+
142+ /* * @see ResponseOutputItem.asMcpListTools */
143+ fun asMcpListTools (): ResponseOutputItem .McpListTools = rawOutputItem.asMcpListTools()
144+
84145 /* * @see ResponseOutputItem._json */
85146 fun _json (): Optional <JsonValue > = rawOutputItem._json ()
86147
@@ -93,6 +154,12 @@ class StructuredResponseOutputItem<T : Any>(
93154 isWebSearchCall() -> visitor.visitWebSearchCall(asWebSearchCall())
94155 isComputerCall() -> visitor.visitComputerCall(asComputerCall())
95156 isReasoning() -> visitor.visitReasoning(asReasoning())
157+ isCodeInterpreterCall() -> visitor.visitCodeInterpreterCall(asCodeInterpreterCall())
158+ isImageGenerationCall() -> visitor.visitImageGenerationCall(asImageGenerationCall())
159+ isLocalShellCall() -> visitor.visitLocalShellCall(asLocalShellCall())
160+ isMcpApprovalRequest() -> visitor.visitMcpApprovalRequest(asMcpApprovalRequest())
161+ isMcpCall() -> visitor.visitMcpCall(asMcpCall())
162+ isMcpListTools() -> visitor.visitMcpListTools(asMcpListTools())
96163 else -> visitor.unknown(_json ().getOrNull())
97164 }
98165
@@ -129,6 +196,38 @@ class StructuredResponseOutputItem<T : Any>(
129196 override fun visitReasoning (reasoning : ResponseReasoningItem ) {
130197 reasoning.validate()
131198 }
199+
200+ override fun visitCodeInterpreterCall (
201+ codeInterpreterCall : ResponseCodeInterpreterToolCall
202+ ) {
203+ codeInterpreterCall.validate()
204+ }
205+
206+ override fun visitImageGenerationCall (
207+ imageGenerationCall : ResponseOutputItem .ImageGenerationCall
208+ ) {
209+ imageGenerationCall.validate()
210+ }
211+
212+ override fun visitLocalShellCall (
213+ localShellCall : ResponseOutputItem .LocalShellCall
214+ ) {
215+ localShellCall.validate()
216+ }
217+
218+ override fun visitMcpApprovalRequest (
219+ mcpApprovalRequest : ResponseOutputItem .McpApprovalRequest
220+ ) {
221+ mcpApprovalRequest.validate()
222+ }
223+
224+ override fun visitMcpCall (mcpCall : ResponseOutputItem .McpCall ) {
225+ mcpCall.validate()
226+ }
227+
228+ override fun visitMcpListTools (mcpListTools : ResponseOutputItem .McpListTools ) {
229+ mcpListTools.validate()
230+ }
132231 }
133232 )
134233 validated = true
@@ -181,6 +280,24 @@ class StructuredResponseOutputItem<T : Any>(
181280 /* * @see ResponseOutputItem.Visitor.visitReasoning */
182281 fun visitReasoning (reasoning : ResponseReasoningItem ): T
183282
283+ /* * @see ResponseOutputItem.Visitor.visitCodeInterpreterCall */
284+ fun visitCodeInterpreterCall (codeInterpreterCall : ResponseCodeInterpreterToolCall ): T
285+
286+ /* * @see ResponseOutputItem.Visitor.visitImageGenerationCall */
287+ fun visitImageGenerationCall (imageGenerationCall : ResponseOutputItem .ImageGenerationCall ): T
288+
289+ /* * @see ResponseOutputItem.Visitor.visitLocalShellCall */
290+ fun visitLocalShellCall (localShellCall : ResponseOutputItem .LocalShellCall ): T
291+
292+ /* * @see ResponseOutputItem.Visitor.visitMcpApprovalRequest */
293+ fun visitMcpApprovalRequest (mcpApprovalRequest : ResponseOutputItem .McpApprovalRequest ): T
294+
295+ /* * @see ResponseOutputItem.Visitor.visitMcpCall */
296+ fun visitMcpCall (mcpCall : ResponseOutputItem .McpCall ): T
297+
298+ /* * @see ResponseOutputItem.Visitor.visitMcpListTools */
299+ fun visitMcpListTools (mcpListTools : ResponseOutputItem .McpListTools ): T
300+
184301 /* * @see ResponseOutputItem.Visitor.unknown */
185302 fun unknown (json : JsonValue ? ): T {
186303 throw OpenAIInvalidDataException (" Unknown ResponseOutputItem: $json " )
0 commit comments