@meetkai/mka1 0.54.7 → 0.54.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcp-server.js +492 -368
- package/bin/mcp-server.js.map +35 -32
- package/dist/commonjs/hooks/multipartFilename.d.ts +12 -0
- package/dist/commonjs/hooks/multipartFilename.d.ts.map +1 -0
- package/dist/commonjs/hooks/multipartFilename.js +50 -0
- package/dist/commonjs/hooks/multipartFilename.js.map +1 -0
- package/dist/commonjs/hooks/registration.d.ts.map +1 -1
- package/dist/commonjs/hooks/registration.js +2 -1
- package/dist/commonjs/hooks/registration.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/models/components/agentschedulespec.d.ts +2 -1
- package/dist/commonjs/models/components/agentschedulespec.d.ts.map +1 -1
- package/dist/commonjs/models/components/agentschedulespec.js +6 -5
- package/dist/commonjs/models/components/agentschedulespec.js.map +1 -1
- package/dist/commonjs/models/components/chunkingstrategy.d.ts +2 -1
- package/dist/commonjs/models/components/chunkingstrategy.d.ts.map +1 -1
- package/dist/commonjs/models/components/chunkingstrategy.js +6 -5
- package/dist/commonjs/models/components/chunkingstrategy.js.map +1 -1
- package/dist/commonjs/models/components/codeinterpreteroutput.d.ts +2 -1
- package/dist/commonjs/models/components/codeinterpreteroutput.d.ts.map +1 -1
- package/dist/commonjs/models/components/codeinterpreteroutput.js +5 -4
- package/dist/commonjs/models/components/codeinterpreteroutput.js.map +1 -1
- package/dist/commonjs/models/components/computeraction.d.ts +2 -1
- package/dist/commonjs/models/components/computeraction.d.ts.map +1 -1
- package/dist/commonjs/models/components/computeraction.js +12 -11
- package/dist/commonjs/models/components/computeraction.js.map +1 -1
- package/dist/commonjs/models/components/customtoolformat.d.ts +2 -1
- package/dist/commonjs/models/components/customtoolformat.d.ts.map +1 -1
- package/dist/commonjs/models/components/customtoolformat.js +5 -1
- package/dist/commonjs/models/components/customtoolformat.js.map +1 -1
- package/dist/commonjs/models/components/filesearchcompoundfilter.d.ts +3 -2
- package/dist/commonjs/models/components/filesearchcompoundfilter.d.ts.map +1 -1
- package/dist/commonjs/models/components/filesearchcompoundfilter.js +21 -20
- package/dist/commonjs/models/components/filesearchcompoundfilter.js.map +1 -1
- package/dist/commonjs/models/components/guardrailconfig.d.ts +2 -1
- package/dist/commonjs/models/components/guardrailconfig.d.ts.map +1 -1
- package/dist/commonjs/models/components/guardrailconfig.js +6 -5
- package/dist/commonjs/models/components/guardrailconfig.js.map +1 -1
- package/dist/commonjs/models/components/method.d.ts +6 -5
- package/dist/commonjs/models/components/method.d.ts.map +1 -1
- package/dist/commonjs/models/components/method.js +36 -35
- package/dist/commonjs/models/components/method.js.map +1 -1
- package/dist/commonjs/models/components/openaichatcompletionchoice.d.ts +4 -3
- package/dist/commonjs/models/components/openaichatcompletionchoice.d.ts.map +1 -1
- package/dist/commonjs/models/components/openaichatcompletionchoice.js +19 -18
- package/dist/commonjs/models/components/openaichatcompletionchoice.js.map +1 -1
- package/dist/commonjs/models/components/openaichatcompletionchunk.d.ts +4 -3
- package/dist/commonjs/models/components/openaichatcompletionchunk.d.ts.map +1 -1
- package/dist/commonjs/models/components/openaichatcompletionchunk.js +19 -18
- package/dist/commonjs/models/components/openaichatcompletionchunk.js.map +1 -1
- package/dist/commonjs/models/components/outputmessage.d.ts +3 -2
- package/dist/commonjs/models/components/outputmessage.d.ts.map +1 -1
- package/dist/commonjs/models/components/outputmessage.js +9 -8
- package/dist/commonjs/models/components/outputmessage.js.map +1 -1
- package/dist/commonjs/models/components/outputmessagewithid.d.ts +3 -2
- package/dist/commonjs/models/components/outputmessagewithid.d.ts.map +1 -1
- package/dist/commonjs/models/components/outputmessagewithid.js +9 -8
- package/dist/commonjs/models/components/outputmessagewithid.js.map +1 -1
- package/dist/commonjs/models/components/outputtext.d.ts +3 -2
- package/dist/commonjs/models/components/outputtext.d.ts.map +1 -1
- package/dist/commonjs/models/components/outputtext.js +13 -12
- package/dist/commonjs/models/components/outputtext.js.map +1 -1
- package/dist/commonjs/models/components/responsecontentpartaddedevent.d.ts +3 -2
- package/dist/commonjs/models/components/responsecontentpartaddedevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/responsecontentpartaddedevent.js +11 -11
- package/dist/commonjs/models/components/responsecontentpartaddedevent.js.map +1 -1
- package/dist/commonjs/models/components/responsecontentpartdoneevent.d.ts +3 -2
- package/dist/commonjs/models/components/responsecontentpartdoneevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/responsecontentpartdoneevent.js +11 -10
- package/dist/commonjs/models/components/responsecontentpartdoneevent.js.map +1 -1
- package/dist/commonjs/models/components/responseformat.d.ts +2 -1
- package/dist/commonjs/models/components/responseformat.d.ts.map +1 -1
- package/dist/commonjs/models/components/responseformat.js +6 -5
- package/dist/commonjs/models/components/responseformat.js.map +1 -1
- package/dist/commonjs/models/components/responseobject.d.ts +5 -4
- package/dist/commonjs/models/components/responseobject.d.ts.map +1 -1
- package/dist/commonjs/models/components/responseobject.js +41 -40
- package/dist/commonjs/models/components/responseobject.js.map +1 -1
- package/dist/commonjs/models/components/responsestreamingevent.d.ts +2 -1
- package/dist/commonjs/models/components/responsestreamingevent.d.ts.map +1 -1
- package/dist/commonjs/models/components/responsestreamingevent.js +68 -67
- package/dist/commonjs/models/components/responsestreamingevent.js.map +1 -1
- package/dist/commonjs/models/components/shellenvironment.d.ts +2 -1
- package/dist/commonjs/models/components/shellenvironment.d.ts.map +1 -1
- package/dist/commonjs/models/components/shellenvironment.js +5 -4
- package/dist/commonjs/models/components/shellenvironment.js.map +1 -1
- package/dist/commonjs/models/components/skillentry.d.ts +2 -1
- package/dist/commonjs/models/components/skillentry.d.ts.map +1 -1
- package/dist/commonjs/models/components/skillentry.js +5 -4
- package/dist/commonjs/models/components/skillentry.js.map +1 -1
- package/dist/commonjs/models/components/tooldefinition.d.ts +5 -4
- package/dist/commonjs/models/components/tooldefinition.d.ts.map +1 -1
- package/dist/commonjs/models/components/tooldefinition.js +29 -28
- package/dist/commonjs/models/components/tooldefinition.js.map +1 -1
- package/dist/commonjs/models/components/websearchaction.d.ts +2 -1
- package/dist/commonjs/models/components/websearchaction.d.ts.map +1 -1
- package/dist/commonjs/models/components/websearchaction.js +6 -5
- package/dist/commonjs/models/components/websearchaction.js.map +1 -1
- package/dist/commonjs/models/operations/createchatcompletionstream.d.ts +2 -1
- package/dist/commonjs/models/operations/createchatcompletionstream.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createchatcompletionstream.js +6 -5
- package/dist/commonjs/models/operations/createchatcompletionstream.js.map +1 -1
- package/dist/commonjs/models/operations/uploadfile.d.ts +1 -1
- package/dist/commonjs/types/discriminatedUnion.d.ts +25 -0
- package/dist/commonjs/types/discriminatedUnion.d.ts.map +1 -0
- package/dist/commonjs/types/discriminatedUnion.js +94 -0
- package/dist/commonjs/types/discriminatedUnion.js.map +1 -0
- package/dist/esm/hooks/multipartFilename.d.ts +12 -0
- package/dist/esm/hooks/multipartFilename.d.ts.map +1 -0
- package/dist/esm/hooks/multipartFilename.js +46 -0
- package/dist/esm/hooks/multipartFilename.js.map +1 -0
- package/dist/esm/hooks/registration.d.ts.map +1 -1
- package/dist/esm/hooks/registration.js +2 -1
- package/dist/esm/hooks/registration.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/models/components/agentschedulespec.d.ts +2 -1
- package/dist/esm/models/components/agentschedulespec.d.ts.map +1 -1
- package/dist/esm/models/components/agentschedulespec.js +6 -5
- package/dist/esm/models/components/agentschedulespec.js.map +1 -1
- package/dist/esm/models/components/chunkingstrategy.d.ts +2 -1
- package/dist/esm/models/components/chunkingstrategy.d.ts.map +1 -1
- package/dist/esm/models/components/chunkingstrategy.js +6 -5
- package/dist/esm/models/components/chunkingstrategy.js.map +1 -1
- package/dist/esm/models/components/codeinterpreteroutput.d.ts +2 -1
- package/dist/esm/models/components/codeinterpreteroutput.d.ts.map +1 -1
- package/dist/esm/models/components/codeinterpreteroutput.js +5 -4
- package/dist/esm/models/components/codeinterpreteroutput.js.map +1 -1
- package/dist/esm/models/components/computeraction.d.ts +2 -1
- package/dist/esm/models/components/computeraction.d.ts.map +1 -1
- package/dist/esm/models/components/computeraction.js +12 -11
- package/dist/esm/models/components/computeraction.js.map +1 -1
- package/dist/esm/models/components/customtoolformat.d.ts +2 -1
- package/dist/esm/models/components/customtoolformat.d.ts.map +1 -1
- package/dist/esm/models/components/customtoolformat.js +5 -1
- package/dist/esm/models/components/customtoolformat.js.map +1 -1
- package/dist/esm/models/components/filesearchcompoundfilter.d.ts +3 -2
- package/dist/esm/models/components/filesearchcompoundfilter.d.ts.map +1 -1
- package/dist/esm/models/components/filesearchcompoundfilter.js +21 -20
- package/dist/esm/models/components/filesearchcompoundfilter.js.map +1 -1
- package/dist/esm/models/components/guardrailconfig.d.ts +2 -1
- package/dist/esm/models/components/guardrailconfig.d.ts.map +1 -1
- package/dist/esm/models/components/guardrailconfig.js +6 -5
- package/dist/esm/models/components/guardrailconfig.js.map +1 -1
- package/dist/esm/models/components/method.d.ts +6 -5
- package/dist/esm/models/components/method.d.ts.map +1 -1
- package/dist/esm/models/components/method.js +36 -35
- package/dist/esm/models/components/method.js.map +1 -1
- package/dist/esm/models/components/openaichatcompletionchoice.d.ts +4 -3
- package/dist/esm/models/components/openaichatcompletionchoice.d.ts.map +1 -1
- package/dist/esm/models/components/openaichatcompletionchoice.js +19 -18
- package/dist/esm/models/components/openaichatcompletionchoice.js.map +1 -1
- package/dist/esm/models/components/openaichatcompletionchunk.d.ts +4 -3
- package/dist/esm/models/components/openaichatcompletionchunk.d.ts.map +1 -1
- package/dist/esm/models/components/openaichatcompletionchunk.js +19 -18
- package/dist/esm/models/components/openaichatcompletionchunk.js.map +1 -1
- package/dist/esm/models/components/outputmessage.d.ts +3 -2
- package/dist/esm/models/components/outputmessage.d.ts.map +1 -1
- package/dist/esm/models/components/outputmessage.js +9 -8
- package/dist/esm/models/components/outputmessage.js.map +1 -1
- package/dist/esm/models/components/outputmessagewithid.d.ts +3 -2
- package/dist/esm/models/components/outputmessagewithid.d.ts.map +1 -1
- package/dist/esm/models/components/outputmessagewithid.js +9 -8
- package/dist/esm/models/components/outputmessagewithid.js.map +1 -1
- package/dist/esm/models/components/outputtext.d.ts +3 -2
- package/dist/esm/models/components/outputtext.d.ts.map +1 -1
- package/dist/esm/models/components/outputtext.js +13 -12
- package/dist/esm/models/components/outputtext.js.map +1 -1
- package/dist/esm/models/components/responsecontentpartaddedevent.d.ts +3 -2
- package/dist/esm/models/components/responsecontentpartaddedevent.d.ts.map +1 -1
- package/dist/esm/models/components/responsecontentpartaddedevent.js +11 -11
- package/dist/esm/models/components/responsecontentpartaddedevent.js.map +1 -1
- package/dist/esm/models/components/responsecontentpartdoneevent.d.ts +3 -2
- package/dist/esm/models/components/responsecontentpartdoneevent.d.ts.map +1 -1
- package/dist/esm/models/components/responsecontentpartdoneevent.js +11 -10
- package/dist/esm/models/components/responsecontentpartdoneevent.js.map +1 -1
- package/dist/esm/models/components/responseformat.d.ts +2 -1
- package/dist/esm/models/components/responseformat.d.ts.map +1 -1
- package/dist/esm/models/components/responseformat.js +6 -5
- package/dist/esm/models/components/responseformat.js.map +1 -1
- package/dist/esm/models/components/responseobject.d.ts +5 -4
- package/dist/esm/models/components/responseobject.d.ts.map +1 -1
- package/dist/esm/models/components/responseobject.js +41 -40
- package/dist/esm/models/components/responseobject.js.map +1 -1
- package/dist/esm/models/components/responsestreamingevent.d.ts +2 -1
- package/dist/esm/models/components/responsestreamingevent.d.ts.map +1 -1
- package/dist/esm/models/components/responsestreamingevent.js +68 -67
- package/dist/esm/models/components/responsestreamingevent.js.map +1 -1
- package/dist/esm/models/components/shellenvironment.d.ts +2 -1
- package/dist/esm/models/components/shellenvironment.d.ts.map +1 -1
- package/dist/esm/models/components/shellenvironment.js +5 -4
- package/dist/esm/models/components/shellenvironment.js.map +1 -1
- package/dist/esm/models/components/skillentry.d.ts +2 -1
- package/dist/esm/models/components/skillentry.d.ts.map +1 -1
- package/dist/esm/models/components/skillentry.js +5 -4
- package/dist/esm/models/components/skillentry.js.map +1 -1
- package/dist/esm/models/components/tooldefinition.d.ts +5 -4
- package/dist/esm/models/components/tooldefinition.d.ts.map +1 -1
- package/dist/esm/models/components/tooldefinition.js +29 -28
- package/dist/esm/models/components/tooldefinition.js.map +1 -1
- package/dist/esm/models/components/websearchaction.d.ts +2 -1
- package/dist/esm/models/components/websearchaction.d.ts.map +1 -1
- package/dist/esm/models/components/websearchaction.js +6 -5
- package/dist/esm/models/components/websearchaction.js.map +1 -1
- package/dist/esm/models/operations/createchatcompletionstream.d.ts +2 -1
- package/dist/esm/models/operations/createchatcompletionstream.d.ts.map +1 -1
- package/dist/esm/models/operations/createchatcompletionstream.js +6 -5
- package/dist/esm/models/operations/createchatcompletionstream.js.map +1 -1
- package/dist/esm/models/operations/uploadfile.d.ts +1 -1
- package/dist/esm/types/discriminatedUnion.d.ts +25 -0
- package/dist/esm/types/discriminatedUnion.d.ts.map +1 -0
- package/dist/esm/types/discriminatedUnion.js +57 -0
- package/dist/esm/types/discriminatedUnion.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/hooks/multipartFilename.ts +60 -0
- package/src/hooks/registration.ts +2 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/agentschedulespec.ts +9 -6
- package/src/models/components/chunkingstrategy.ts +9 -6
- package/src/models/components/codeinterpreteroutput.ts +8 -5
- package/src/models/components/computeraction.ts +15 -12
- package/src/models/components/customtoolformat.ts +10 -2
- package/src/models/components/filesearchcompoundfilter.ts +41 -39
- package/src/models/components/guardrailconfig.ts +9 -6
- package/src/models/components/method.ts +75 -43
- package/src/models/components/openaichatcompletionchoice.ts +24 -21
- package/src/models/components/openaichatcompletionchunk.ts +24 -21
- package/src/models/components/outputmessage.ts +19 -10
- package/src/models/components/outputmessagewithid.ts +19 -10
- package/src/models/components/outputtext.ts +23 -16
- package/src/models/components/responsecontentpartaddedevent.ts +25 -13
- package/src/models/components/responsecontentpartdoneevent.ts +22 -12
- package/src/models/components/responseformat.ts +9 -6
- package/src/models/components/responseobject.ts +62 -48
- package/src/models/components/responsestreamingevent.ts +118 -68
- package/src/models/components/shellenvironment.ts +8 -5
- package/src/models/components/skillentry.ts +10 -5
- package/src/models/components/tooldefinition.ts +42 -31
- package/src/models/components/websearchaction.ts +12 -6
- package/src/models/operations/createchatcompletionstream.ts +12 -6
- package/src/models/operations/uploadfile.ts +1 -1
- package/src/types/discriminatedUnion.ts +96 -0
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import * as discriminatedUnionTypes from "../../types/discriminatedUnion.js";
|
|
8
|
+
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
|
|
7
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
11
|
import {
|
|
@@ -462,80 +464,128 @@ export type ResponseStreamingEvent =
|
|
|
462
464
|
| ResponseCustomToolCallInputDeltaEvent
|
|
463
465
|
| ResponseCustomToolCallInputDoneEvent
|
|
464
466
|
| ResponseOutputTextAnnotationAddedEvent
|
|
465
|
-
| ErrorEvent
|
|
467
|
+
| ErrorEvent
|
|
468
|
+
| discriminatedUnionTypes.Unknown<"type">;
|
|
466
469
|
|
|
467
470
|
/** @internal */
|
|
468
471
|
export const ResponseStreamingEvent$inboundSchema: z.ZodType<
|
|
469
472
|
ResponseStreamingEvent,
|
|
470
473
|
z.ZodTypeDef,
|
|
471
474
|
unknown
|
|
472
|
-
> =
|
|
473
|
-
ResponseCreatedEvent$inboundSchema,
|
|
474
|
-
ResponseInProgressEvent$inboundSchema,
|
|
475
|
-
ResponseCompletedEvent$inboundSchema,
|
|
476
|
-
ResponseFailedEvent$inboundSchema,
|
|
477
|
-
ResponseIncompleteEvent$inboundSchema,
|
|
478
|
-
ResponseQueuedEvent$inboundSchema,
|
|
479
|
-
ResponseCancelledEvent$inboundSchema,
|
|
480
|
-
ResponseOutputItemAddedEvent$inboundSchema,
|
|
481
|
-
ResponseOutputItemDoneEvent$inboundSchema,
|
|
482
|
-
ResponseContentPartAddedEvent$inboundSchema,
|
|
483
|
-
ResponseContentPartDoneEvent$inboundSchema,
|
|
484
|
-
ResponseOutputTextDeltaEvent$inboundSchema,
|
|
485
|
-
ResponseOutputTextDoneEvent$inboundSchema,
|
|
486
|
-
ResponseRefusalDeltaEvent$inboundSchema,
|
|
487
|
-
ResponseRefusalDoneEvent$inboundSchema,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
]
|
|
475
|
+
> = discriminatedUnion("type", {
|
|
476
|
+
["response.created"]: ResponseCreatedEvent$inboundSchema,
|
|
477
|
+
["response.in_progress"]: ResponseInProgressEvent$inboundSchema,
|
|
478
|
+
["response.completed"]: ResponseCompletedEvent$inboundSchema,
|
|
479
|
+
["response.failed"]: ResponseFailedEvent$inboundSchema,
|
|
480
|
+
["response.incomplete"]: ResponseIncompleteEvent$inboundSchema,
|
|
481
|
+
["response.queued"]: ResponseQueuedEvent$inboundSchema,
|
|
482
|
+
["response.cancelled"]: ResponseCancelledEvent$inboundSchema,
|
|
483
|
+
["response.output_item.added"]: ResponseOutputItemAddedEvent$inboundSchema,
|
|
484
|
+
["response.output_item.done"]: ResponseOutputItemDoneEvent$inboundSchema,
|
|
485
|
+
["response.content_part.added"]: ResponseContentPartAddedEvent$inboundSchema,
|
|
486
|
+
["response.content_part.done"]: ResponseContentPartDoneEvent$inboundSchema,
|
|
487
|
+
["response.output_text.delta"]: ResponseOutputTextDeltaEvent$inboundSchema,
|
|
488
|
+
["response.output_text.done"]: ResponseOutputTextDoneEvent$inboundSchema,
|
|
489
|
+
["response.refusal.delta"]: ResponseRefusalDeltaEvent$inboundSchema,
|
|
490
|
+
["response.refusal.done"]: ResponseRefusalDoneEvent$inboundSchema,
|
|
491
|
+
["response.function_call_arguments.delta"]:
|
|
492
|
+
ResponseFunctionCallArgumentsDeltaEvent$inboundSchema,
|
|
493
|
+
["response.function_call_arguments.done"]:
|
|
494
|
+
ResponseFunctionCallArgumentsDoneEvent$inboundSchema,
|
|
495
|
+
["response.file_search_call.in_progress"]:
|
|
496
|
+
ResponseFileSearchCallInProgressEvent$inboundSchema,
|
|
497
|
+
["response.file_search_call.searching"]:
|
|
498
|
+
ResponseFileSearchCallSearchingEvent$inboundSchema,
|
|
499
|
+
["response.file_search_call.completed"]:
|
|
500
|
+
ResponseFileSearchCallCompletedEvent$inboundSchema,
|
|
501
|
+
["response.web_search_call.in_progress"]:
|
|
502
|
+
ResponseWebSearchCallInProgressEvent$inboundSchema,
|
|
503
|
+
["response.web_search_call.searching"]:
|
|
504
|
+
ResponseWebSearchCallSearchingEvent$inboundSchema,
|
|
505
|
+
["response.web_search_call.completed"]:
|
|
506
|
+
ResponseWebSearchCallCompletedEvent$inboundSchema,
|
|
507
|
+
["response.history_call.in_progress"]:
|
|
508
|
+
ResponseHistoryCallInProgressEvent$inboundSchema,
|
|
509
|
+
["response.history_call.searching"]:
|
|
510
|
+
ResponseHistoryCallSearchingEvent$inboundSchema,
|
|
511
|
+
["response.history_call.completed"]:
|
|
512
|
+
ResponseHistoryCallCompletedEvent$inboundSchema,
|
|
513
|
+
["response.sleep_call.in_progress"]:
|
|
514
|
+
ResponseSleepCallInProgressEvent$inboundSchema,
|
|
515
|
+
["response.sleep_call.sleeping"]:
|
|
516
|
+
ResponseSleepCallSleepingEvent$inboundSchema,
|
|
517
|
+
["response.sleep_call.completed"]:
|
|
518
|
+
ResponseSleepCallCompletedEvent$inboundSchema,
|
|
519
|
+
["response.tool_search_call.in_progress"]:
|
|
520
|
+
ResponseToolSearchCallInProgressEvent$inboundSchema,
|
|
521
|
+
["response.tool_search_call.searching"]:
|
|
522
|
+
ResponseToolSearchCallSearchingEvent$inboundSchema,
|
|
523
|
+
["response.tool_search_call.completed"]:
|
|
524
|
+
ResponseToolSearchCallCompletedEvent$inboundSchema,
|
|
525
|
+
["response.reasoning_summary_part.added"]:
|
|
526
|
+
ResponseReasoningSummaryPartAddedEvent$inboundSchema,
|
|
527
|
+
["response.reasoning_summary_part.done"]:
|
|
528
|
+
ResponseReasoningSummaryPartDoneEvent$inboundSchema,
|
|
529
|
+
["response.reasoning_summary_text.delta"]:
|
|
530
|
+
ResponseReasoningSummaryTextDeltaEvent$inboundSchema,
|
|
531
|
+
["response.reasoning_summary_text.done"]:
|
|
532
|
+
ResponseReasoningSummaryTextDoneEvent$inboundSchema,
|
|
533
|
+
["response.reasoning_text.delta"]:
|
|
534
|
+
ResponseReasoningTextDeltaEvent$inboundSchema,
|
|
535
|
+
["response.reasoning_text.done"]:
|
|
536
|
+
ResponseReasoningTextDoneEvent$inboundSchema,
|
|
537
|
+
["response.image_generation_call.in_progress"]:
|
|
538
|
+
ResponseImageGenerationCallInProgressEvent$inboundSchema,
|
|
539
|
+
["response.image_generation_call.generating"]:
|
|
540
|
+
ResponseImageGenerationCallGeneratingEvent$inboundSchema,
|
|
541
|
+
["response.image_generation_call.completed"]:
|
|
542
|
+
ResponseImageGenerationCallCompletedEvent$inboundSchema,
|
|
543
|
+
["response.image_generation_call.partial_image"]:
|
|
544
|
+
ResponseImageGenerationCallPartialImageEvent$inboundSchema,
|
|
545
|
+
["response.mcp_call_arguments.delta"]:
|
|
546
|
+
ResponseMCPCallArgumentsDeltaEvent$inboundSchema,
|
|
547
|
+
["response.mcp_call_arguments.done"]:
|
|
548
|
+
ResponseMCPCallArgumentsDoneEvent$inboundSchema,
|
|
549
|
+
["response.mcp_call.in_progress"]:
|
|
550
|
+
ResponseMCPCallInProgressEvent$inboundSchema,
|
|
551
|
+
["response.mcp_call.completed"]: ResponseMCPCallCompletedEvent$inboundSchema,
|
|
552
|
+
["response.mcp_call.failed"]: ResponseMCPCallFailedEvent$inboundSchema,
|
|
553
|
+
["response.mcp_list_tools.in_progress"]:
|
|
554
|
+
ResponseMCPListToolsInProgressEvent$inboundSchema,
|
|
555
|
+
["response.mcp_list_tools.completed"]:
|
|
556
|
+
ResponseMCPListToolsCompletedEvent$inboundSchema,
|
|
557
|
+
["response.mcp_list_tools.failed"]:
|
|
558
|
+
ResponseMCPListToolsFailedEvent$inboundSchema,
|
|
559
|
+
["response.read_file_call.in_progress"]:
|
|
560
|
+
ResponseReadFileCallInProgressEvent$inboundSchema,
|
|
561
|
+
["response.read_file_call.reading"]:
|
|
562
|
+
ResponseReadFileCallReadingEvent$inboundSchema,
|
|
563
|
+
["response.read_file_call.completed"]:
|
|
564
|
+
ResponseReadFileCallCompletedEvent$inboundSchema,
|
|
565
|
+
["response.code_interpreter_call.in_progress"]:
|
|
566
|
+
ResponseCodeInterpreterCallInProgressEvent$inboundSchema,
|
|
567
|
+
["response.code_interpreter_call.interpreting"]:
|
|
568
|
+
ResponseCodeInterpreterCallInterpretingEvent$inboundSchema,
|
|
569
|
+
["response.code_interpreter_call.completed"]:
|
|
570
|
+
ResponseCodeInterpreterCallCompletedEvent$inboundSchema,
|
|
571
|
+
["response.code_interpreter_call_code.delta"]:
|
|
572
|
+
ResponseCodeInterpreterCallCodeDeltaEvent$inboundSchema,
|
|
573
|
+
["response.code_interpreter_call_code.done"]:
|
|
574
|
+
ResponseCodeInterpreterCallCodeDoneEvent$inboundSchema,
|
|
575
|
+
["response.shell_call.in_progress"]:
|
|
576
|
+
ResponseShellCallInProgressEvent$inboundSchema,
|
|
577
|
+
["response.shell_call.executing"]:
|
|
578
|
+
ResponseShellCallExecutingEvent$inboundSchema,
|
|
579
|
+
["response.shell_call.completed"]:
|
|
580
|
+
ResponseShellCallCompletedEvent$inboundSchema,
|
|
581
|
+
["response.custom_tool_call_input.delta"]:
|
|
582
|
+
ResponseCustomToolCallInputDeltaEvent$inboundSchema,
|
|
583
|
+
["response.custom_tool_call_input.done"]:
|
|
584
|
+
ResponseCustomToolCallInputDoneEvent$inboundSchema,
|
|
585
|
+
["response.output_text.annotation.added"]:
|
|
586
|
+
ResponseOutputTextAnnotationAddedEvent$inboundSchema,
|
|
587
|
+
error: ErrorEvent$inboundSchema,
|
|
588
|
+
});
|
|
539
589
|
/** @internal */
|
|
540
590
|
export type ResponseStreamingEvent$Outbound =
|
|
541
591
|
| ResponseCreatedEvent$Outbound
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import * as discriminatedUnionTypes from "../../types/discriminatedUnion.js";
|
|
8
|
+
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
|
|
7
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
11
|
import {
|
|
@@ -21,17 +23,18 @@ import {
|
|
|
21
23
|
|
|
22
24
|
export type ShellEnvironment =
|
|
23
25
|
| ShellEnvironmentContainerAuto
|
|
24
|
-
| ShellEnvironmentContainerReference
|
|
26
|
+
| ShellEnvironmentContainerReference
|
|
27
|
+
| discriminatedUnionTypes.Unknown<"type">;
|
|
25
28
|
|
|
26
29
|
/** @internal */
|
|
27
30
|
export const ShellEnvironment$inboundSchema: z.ZodType<
|
|
28
31
|
ShellEnvironment,
|
|
29
32
|
z.ZodTypeDef,
|
|
30
33
|
unknown
|
|
31
|
-
> =
|
|
32
|
-
ShellEnvironmentContainerAuto$inboundSchema,
|
|
33
|
-
ShellEnvironmentContainerReference$inboundSchema,
|
|
34
|
-
|
|
34
|
+
> = discriminatedUnion("type", {
|
|
35
|
+
container_auto: ShellEnvironmentContainerAuto$inboundSchema,
|
|
36
|
+
container_reference: ShellEnvironmentContainerReference$inboundSchema,
|
|
37
|
+
});
|
|
35
38
|
/** @internal */
|
|
36
39
|
export type ShellEnvironment$Outbound =
|
|
37
40
|
| ShellEnvironmentContainerAuto$Outbound
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import * as discriminatedUnionTypes from "../../types/discriminatedUnion.js";
|
|
8
|
+
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
|
|
7
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
11
|
import {
|
|
@@ -19,17 +21,20 @@ import {
|
|
|
19
21
|
SkillReference$outboundSchema,
|
|
20
22
|
} from "./skillreference.js";
|
|
21
23
|
|
|
22
|
-
export type SkillEntry =
|
|
24
|
+
export type SkillEntry =
|
|
25
|
+
| SkillReference
|
|
26
|
+
| PreconfiguredSkillReference
|
|
27
|
+
| discriminatedUnionTypes.Unknown<"type">;
|
|
23
28
|
|
|
24
29
|
/** @internal */
|
|
25
30
|
export const SkillEntry$inboundSchema: z.ZodType<
|
|
26
31
|
SkillEntry,
|
|
27
32
|
z.ZodTypeDef,
|
|
28
33
|
unknown
|
|
29
|
-
> =
|
|
30
|
-
SkillReference$inboundSchema,
|
|
31
|
-
PreconfiguredSkillReference$inboundSchema,
|
|
32
|
-
|
|
34
|
+
> = discriminatedUnion("type", {
|
|
35
|
+
skill_reference: SkillReference$inboundSchema,
|
|
36
|
+
preconfigured: PreconfiguredSkillReference$inboundSchema,
|
|
37
|
+
});
|
|
33
38
|
/** @internal */
|
|
34
39
|
export type SkillEntry$Outbound =
|
|
35
40
|
| SkillReference$Outbound
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as discriminatedUnionTypes from "../../types/discriminatedUnion.js";
|
|
9
|
+
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
|
|
8
10
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
11
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
12
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -83,11 +85,18 @@ export type Environment1 = {
|
|
|
83
85
|
memoryStores?: Array<MemoryStores> | undefined;
|
|
84
86
|
};
|
|
85
87
|
|
|
86
|
-
export type Environment =
|
|
88
|
+
export type Environment =
|
|
89
|
+
| Environment1
|
|
90
|
+
| Environment2
|
|
91
|
+
| discriminatedUnionTypes.Unknown<"type">;
|
|
87
92
|
|
|
88
93
|
export type Seven = {
|
|
89
94
|
type: ToolDefinition7Type;
|
|
90
|
-
environment?:
|
|
95
|
+
environment?:
|
|
96
|
+
| Environment1
|
|
97
|
+
| Environment2
|
|
98
|
+
| discriminatedUnionTypes.Unknown<"type">
|
|
99
|
+
| undefined;
|
|
91
100
|
};
|
|
92
101
|
|
|
93
102
|
export const ToolDefinition6Type = {
|
|
@@ -124,7 +133,8 @@ export type ToolDefinition4Filters =
|
|
|
124
133
|
| (FileSearchComparisonFilter & { type: "lt" })
|
|
125
134
|
| (FileSearchComparisonFilter & { type: "lte" })
|
|
126
135
|
| (FileSearchCompoundFilter & { type: "and" })
|
|
127
|
-
| (FileSearchCompoundFilter & { type: "or" })
|
|
136
|
+
| (FileSearchCompoundFilter & { type: "or" })
|
|
137
|
+
| discriminatedUnionTypes.Unknown<"type">;
|
|
128
138
|
|
|
129
139
|
export type ToolDefinitionRankingOptions = {
|
|
130
140
|
ranker?: string | undefined;
|
|
@@ -143,6 +153,7 @@ export type ToolDefinition4 = {
|
|
|
143
153
|
| (FileSearchComparisonFilter & { type: "lte" })
|
|
144
154
|
| (FileSearchCompoundFilter & { type: "and" })
|
|
145
155
|
| (FileSearchCompoundFilter & { type: "or" })
|
|
156
|
+
| discriminatedUnionTypes.Unknown<"type">
|
|
146
157
|
| undefined;
|
|
147
158
|
maxNumResults?: number | undefined;
|
|
148
159
|
rankingOptions?: ToolDefinitionRankingOptions | undefined;
|
|
@@ -549,10 +560,10 @@ export const Environment$inboundSchema: z.ZodType<
|
|
|
549
560
|
Environment,
|
|
550
561
|
z.ZodTypeDef,
|
|
551
562
|
unknown
|
|
552
|
-
> =
|
|
553
|
-
z.lazy(() => Environment1$inboundSchema),
|
|
554
|
-
z.lazy(() => Environment2$inboundSchema),
|
|
555
|
-
|
|
563
|
+
> = discriminatedUnion("type", {
|
|
564
|
+
container_auto: z.lazy(() => Environment1$inboundSchema),
|
|
565
|
+
container_reference: z.lazy(() => Environment2$inboundSchema),
|
|
566
|
+
});
|
|
556
567
|
/** @internal */
|
|
557
568
|
export type Environment$Outbound =
|
|
558
569
|
| Environment1$Outbound
|
|
@@ -585,10 +596,10 @@ export function environmentFromJSON(
|
|
|
585
596
|
export const Seven$inboundSchema: z.ZodType<Seven, z.ZodTypeDef, unknown> = z
|
|
586
597
|
.object({
|
|
587
598
|
type: ToolDefinition7Type$inboundSchema,
|
|
588
|
-
environment:
|
|
589
|
-
z.lazy(() => Environment1$inboundSchema),
|
|
590
|
-
z.lazy(() => Environment2$inboundSchema),
|
|
591
|
-
|
|
599
|
+
environment: discriminatedUnion("type", {
|
|
600
|
+
container_auto: z.lazy(() => Environment1$inboundSchema),
|
|
601
|
+
container_reference: z.lazy(() => Environment2$inboundSchema),
|
|
602
|
+
}).optional(),
|
|
592
603
|
});
|
|
593
604
|
/** @internal */
|
|
594
605
|
export type Seven$Outbound = {
|
|
@@ -728,32 +739,32 @@ export const ToolDefinition4Filters$inboundSchema: z.ZodType<
|
|
|
728
739
|
ToolDefinition4Filters,
|
|
729
740
|
z.ZodTypeDef,
|
|
730
741
|
unknown
|
|
731
|
-
> =
|
|
732
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
742
|
+
> = discriminatedUnion("type", {
|
|
743
|
+
eq: FileSearchComparisonFilter$inboundSchema.and(
|
|
733
744
|
z.object({ type: z.literal("eq") }),
|
|
734
745
|
),
|
|
735
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
746
|
+
ne: FileSearchComparisonFilter$inboundSchema.and(
|
|
736
747
|
z.object({ type: z.literal("ne") }),
|
|
737
748
|
),
|
|
738
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
749
|
+
gt: FileSearchComparisonFilter$inboundSchema.and(
|
|
739
750
|
z.object({ type: z.literal("gt") }),
|
|
740
751
|
),
|
|
741
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
752
|
+
gte: FileSearchComparisonFilter$inboundSchema.and(
|
|
742
753
|
z.object({ type: z.literal("gte") }),
|
|
743
754
|
),
|
|
744
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
755
|
+
lt: FileSearchComparisonFilter$inboundSchema.and(
|
|
745
756
|
z.object({ type: z.literal("lt") }),
|
|
746
757
|
),
|
|
747
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
758
|
+
lte: FileSearchComparisonFilter$inboundSchema.and(
|
|
748
759
|
z.object({ type: z.literal("lte") }),
|
|
749
760
|
),
|
|
750
|
-
FileSearchCompoundFilter$inboundSchema.and(
|
|
761
|
+
and: FileSearchCompoundFilter$inboundSchema.and(
|
|
751
762
|
z.object({ type: z.literal("and") }),
|
|
752
763
|
),
|
|
753
|
-
FileSearchCompoundFilter$inboundSchema.and(
|
|
764
|
+
or: FileSearchCompoundFilter$inboundSchema.and(
|
|
754
765
|
z.object({ type: z.literal("or") }),
|
|
755
766
|
),
|
|
756
|
-
|
|
767
|
+
});
|
|
757
768
|
/** @internal */
|
|
758
769
|
export type ToolDefinition4Filters$Outbound =
|
|
759
770
|
| (FileSearchComparisonFilter$Outbound & { type: "eq" })
|
|
@@ -874,32 +885,32 @@ export const ToolDefinition4$inboundSchema: z.ZodType<
|
|
|
874
885
|
> = z.object({
|
|
875
886
|
type: ToolDefinition4Type$inboundSchema,
|
|
876
887
|
vector_store_ids: z.array(z.string()),
|
|
877
|
-
filters:
|
|
878
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
888
|
+
filters: discriminatedUnion("type", {
|
|
889
|
+
eq: FileSearchComparisonFilter$inboundSchema.and(
|
|
879
890
|
z.object({ type: z.literal("eq") }),
|
|
880
891
|
),
|
|
881
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
892
|
+
ne: FileSearchComparisonFilter$inboundSchema.and(
|
|
882
893
|
z.object({ type: z.literal("ne") }),
|
|
883
894
|
),
|
|
884
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
895
|
+
gt: FileSearchComparisonFilter$inboundSchema.and(
|
|
885
896
|
z.object({ type: z.literal("gt") }),
|
|
886
897
|
),
|
|
887
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
898
|
+
gte: FileSearchComparisonFilter$inboundSchema.and(
|
|
888
899
|
z.object({ type: z.literal("gte") }),
|
|
889
900
|
),
|
|
890
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
901
|
+
lt: FileSearchComparisonFilter$inboundSchema.and(
|
|
891
902
|
z.object({ type: z.literal("lt") }),
|
|
892
903
|
),
|
|
893
|
-
FileSearchComparisonFilter$inboundSchema.and(
|
|
904
|
+
lte: FileSearchComparisonFilter$inboundSchema.and(
|
|
894
905
|
z.object({ type: z.literal("lte") }),
|
|
895
906
|
),
|
|
896
|
-
FileSearchCompoundFilter$inboundSchema.and(
|
|
907
|
+
and: FileSearchCompoundFilter$inboundSchema.and(
|
|
897
908
|
z.object({ type: z.literal("and") }),
|
|
898
909
|
),
|
|
899
|
-
FileSearchCompoundFilter$inboundSchema.and(
|
|
910
|
+
or: FileSearchCompoundFilter$inboundSchema.and(
|
|
900
911
|
z.object({ type: z.literal("or") }),
|
|
901
912
|
),
|
|
902
|
-
|
|
913
|
+
}).optional(),
|
|
903
914
|
max_num_results: z.number().int().optional(),
|
|
904
915
|
ranking_options: z.lazy(() => ToolDefinitionRankingOptions$inboundSchema)
|
|
905
916
|
.optional(),
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import * as discriminatedUnionTypes from "../../types/discriminatedUnion.js";
|
|
8
|
+
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
|
|
7
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
11
|
import {
|
|
@@ -25,18 +27,22 @@ import {
|
|
|
25
27
|
SearchAction$outboundSchema,
|
|
26
28
|
} from "./searchaction.js";
|
|
27
29
|
|
|
28
|
-
export type WebSearchAction =
|
|
30
|
+
export type WebSearchAction =
|
|
31
|
+
| SearchAction
|
|
32
|
+
| OpenPageAction
|
|
33
|
+
| FindAction
|
|
34
|
+
| discriminatedUnionTypes.Unknown<"type">;
|
|
29
35
|
|
|
30
36
|
/** @internal */
|
|
31
37
|
export const WebSearchAction$inboundSchema: z.ZodType<
|
|
32
38
|
WebSearchAction,
|
|
33
39
|
z.ZodTypeDef,
|
|
34
40
|
unknown
|
|
35
|
-
> =
|
|
36
|
-
SearchAction$inboundSchema,
|
|
37
|
-
OpenPageAction$inboundSchema,
|
|
38
|
-
FindAction$inboundSchema,
|
|
39
|
-
|
|
41
|
+
> = discriminatedUnion("type", {
|
|
42
|
+
search: SearchAction$inboundSchema,
|
|
43
|
+
open_page: OpenPageAction$inboundSchema,
|
|
44
|
+
find: FindAction$inboundSchema,
|
|
45
|
+
});
|
|
40
46
|
/** @internal */
|
|
41
47
|
export type WebSearchAction$Outbound =
|
|
42
48
|
| SearchAction$Outbound
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import * as discriminatedUnionTypes from "../../types/discriminatedUnion.js";
|
|
9
|
+
import { discriminatedUnion } from "../../types/discriminatedUnion.js";
|
|
8
10
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
11
|
import * as components from "../components/index.js";
|
|
10
12
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
@@ -45,7 +47,11 @@ export type One = {
|
|
|
45
47
|
/**
|
|
46
48
|
* OK
|
|
47
49
|
*/
|
|
48
|
-
export type CreateChatCompletionStreamResponseBody =
|
|
50
|
+
export type CreateChatCompletionStreamResponseBody =
|
|
51
|
+
| One
|
|
52
|
+
| Two
|
|
53
|
+
| Three
|
|
54
|
+
| discriminatedUnionTypes.Unknown<"event">;
|
|
49
55
|
|
|
50
56
|
/** @internal */
|
|
51
57
|
export const CreateChatCompletionStreamRequest$inboundSchema: z.ZodType<
|
|
@@ -234,11 +240,11 @@ export const CreateChatCompletionStreamResponseBody$inboundSchema: z.ZodType<
|
|
|
234
240
|
CreateChatCompletionStreamResponseBody,
|
|
235
241
|
z.ZodTypeDef,
|
|
236
242
|
unknown
|
|
237
|
-
> =
|
|
238
|
-
z.lazy(() => One$inboundSchema),
|
|
239
|
-
z.lazy(() => Two$inboundSchema),
|
|
240
|
-
z.lazy(() => Three$inboundSchema),
|
|
241
|
-
|
|
243
|
+
> = discriminatedUnion("event", {
|
|
244
|
+
message: z.lazy(() => One$inboundSchema),
|
|
245
|
+
done: z.lazy(() => Two$inboundSchema),
|
|
246
|
+
error: z.lazy(() => Three$inboundSchema),
|
|
247
|
+
});
|
|
242
248
|
/** @internal */
|
|
243
249
|
export type CreateChatCompletionStreamResponseBody$Outbound =
|
|
244
250
|
| One$Outbound
|
|
@@ -33,7 +33,7 @@ export type Purpose = ClosedEnum<typeof Purpose>;
|
|
|
33
33
|
|
|
34
34
|
export type UploadFileRequestBody = {
|
|
35
35
|
/**
|
|
36
|
-
* The file to upload
|
|
36
|
+
* The file to upload. Multipart file parts must include a nonblank filename; the lowercase WHATWG placeholder filename "blob" is treated as missing.
|
|
37
37
|
*/
|
|
38
38
|
file: FileT | Blob;
|
|
39
39
|
/**
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { startCountingUnrecognized } from "./unrecognized.js";
|
|
7
|
+
|
|
8
|
+
const UNKNOWN = Symbol("UNKNOWN");
|
|
9
|
+
|
|
10
|
+
export type Unknown<Discriminator extends string, UnknownValue = "UNKNOWN"> =
|
|
11
|
+
& {
|
|
12
|
+
[K in Discriminator]: UnknownValue;
|
|
13
|
+
}
|
|
14
|
+
& {
|
|
15
|
+
raw: unknown;
|
|
16
|
+
isUnknown: true;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export function isUnknown<Discriminator extends string>(
|
|
20
|
+
value: unknown,
|
|
21
|
+
): value is Unknown<Discriminator> {
|
|
22
|
+
return typeof value === "object" && value !== null && UNKNOWN in value;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Forward-compatible discriminated union parser.
|
|
27
|
+
*
|
|
28
|
+
* If the input does not match one of the predefined options, it will be
|
|
29
|
+
* captured and available as `{ raw: <original input>, [discriminator]: "UNKNOWN", isUnknown: true }`.
|
|
30
|
+
*
|
|
31
|
+
* @param inputPropertyName - The discriminator property name in the input payload
|
|
32
|
+
* @param options - Map of discriminator values to their corresponding schemas
|
|
33
|
+
* @param opts - Optional configuration object
|
|
34
|
+
* @param opts.unknownValue - The value to use for the discriminator when the input is unknown (default: "UNKNOWN")
|
|
35
|
+
* @param opts.outputPropertyName - Output property name if the sanitized (camelCase) property name differs from inputPropertyName
|
|
36
|
+
*/
|
|
37
|
+
export function discriminatedUnion<
|
|
38
|
+
InputDiscriminator extends string,
|
|
39
|
+
TOptions extends Readonly<Record<string, z.ZodType>>,
|
|
40
|
+
UnknownValue extends string = "UNKNOWN",
|
|
41
|
+
OutputDiscriminator extends string = InputDiscriminator,
|
|
42
|
+
>(
|
|
43
|
+
inputPropertyName: InputDiscriminator,
|
|
44
|
+
options: TOptions,
|
|
45
|
+
opts: {
|
|
46
|
+
unknownValue?: UnknownValue;
|
|
47
|
+
outputPropertyName?: OutputDiscriminator;
|
|
48
|
+
} = {},
|
|
49
|
+
): z.ZodType<
|
|
50
|
+
| z.output<TOptions[keyof TOptions]>
|
|
51
|
+
| Unknown<OutputDiscriminator, UnknownValue>,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
unknown
|
|
54
|
+
> {
|
|
55
|
+
const { unknownValue = "UNKNOWN" as UnknownValue, outputPropertyName } = opts;
|
|
56
|
+
return z.unknown().transform((input) => {
|
|
57
|
+
const fallback = Object.defineProperties(
|
|
58
|
+
{
|
|
59
|
+
raw: input,
|
|
60
|
+
[outputPropertyName ?? inputPropertyName]: unknownValue,
|
|
61
|
+
isUnknown: true as const,
|
|
62
|
+
},
|
|
63
|
+
{ [UNKNOWN]: { value: true, enumerable: false, configurable: false } },
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const isObject = typeof input === "object" && input !== null;
|
|
67
|
+
if (!isObject) return fallback;
|
|
68
|
+
|
|
69
|
+
const discriminator = input[inputPropertyName as keyof typeof input];
|
|
70
|
+
if (typeof discriminator !== "string") return fallback;
|
|
71
|
+
if (!(discriminator in options)) return fallback;
|
|
72
|
+
|
|
73
|
+
const schema = options[discriminator];
|
|
74
|
+
if (!schema) return fallback;
|
|
75
|
+
|
|
76
|
+
// Start counters before parsing to track nested unrecognized/zeroDefault values
|
|
77
|
+
const unrecognizedCtr = startCountingUnrecognized();
|
|
78
|
+
|
|
79
|
+
const result = schema.safeParse(input);
|
|
80
|
+
if (!result.success) {
|
|
81
|
+
// Parse failed - don't propagate any counts from the failed attempt
|
|
82
|
+
unrecognizedCtr.end(0);
|
|
83
|
+
|
|
84
|
+
return fallback;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Parse succeeded - propagate the actual counts
|
|
88
|
+
unrecognizedCtr.end();
|
|
89
|
+
|
|
90
|
+
if (outputPropertyName) {
|
|
91
|
+
(result.data as any)[outputPropertyName] = discriminator;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return result.data;
|
|
95
|
+
}) as any;
|
|
96
|
+
}
|